Transdata™ - isodate

 

Finds duplicate variable names in the transformation models

Convert date time to ISO standard character date

%isodate (indata = input data set,       
       invarn = input numeric date variable,
       invarc = input character date variable,
       outvar = output date variable,
       flagvar = flag variable);


Where Is Type... And represents...
indata C Source data including date variable to be converted.  This is specified with a two level dot notation: libname.dataname. .
invarn N (SAS date format) The SAS date variable that is going to be converted.  This can be either a SAS date or a SAS date time.
invarc C The character date variable.  The expected date variable in the format: yyyy-mm-dd/yyyy-mm/yyyy.
outvar C The name of the variable to be created or updated in the same dataset. 
flagvar C (optional) Flag variable in the documenting imputation for character date imputation.  The output values for this flag variable include:
  • Y - Year
  • M - Month
  • D - Day

Details
The %isodate tool will convert either a character date or a SAS numeric date variable to a character ISO date format according to the CDISC guidelines.  You can only specify either a numeric input date variable (INVARN) or character date variable (INVARC) and not both.  The macro can be invoked multiple times to handle multiple variables within one dataset.

For character date variables, an imputation will be applied and the estimated date part will be documented in the flag variable.  

The following error checking will be performed and the corresponding messages are produced.

  • Invalid Input Data
    ERROR: [isodate] contains an invalid input dataset specified in the INDATA parameter.
  • Invalid Input Numeric Date
    • ERROR: [isodate] contains an invalid variable specified in the parameter INVARC.
    • ERROR: [isodate] contains an invalid variable specified in the parameter INVARN.
  • Wrong Date Format
    • ERROR: [isodate] contains a date variable specified in the parameter INVARC that is in a wrong format.
    • ERROR: [isodate] contains a date variable specified in the parameter INVARC that is in a wrong format.
  • Invalid Output Variable
    ERROR: [isodate] had an invalid output variable that is invalid specified in parameter OUTVAR.
    NOTE: Valid variables must contain no special characters and is 8 characters or less.
  • Invalid Flag Variable
    ERROR: [isodate] had an invalid flag variable that is invalid specified in parameter FLAGVAR.
    NOTE: Valid variables must contain no special characters and is 8 characters or less.

Example

%isodate (indata = inblib.ae,
                     invarn = aedaten,
                     outvar = isodate,
                     flagvar = fisodate);

%isodate (indata = inblib.ae,
                     invarc = aedatec,
                     outvar = isodate,
                     flagvar = fisodate);
 

%isodate (indata = inblib.ae,
                     invarc = aedatec,
                     outvar = isodate);
 
    Transdata - ETL CDISC Software,  Meta-Xceed Inc.© 2009
Bookmark and Share