%INCLUDE 'c:\SASMACRO\DDENTRYMACRO.sas' ; * ******************************************************************************; * READ_DD.SAS Program, to read a data dictionary from an Excel file and create * SAS code to read in the data, apply formats and labels and to perform * a prelimiary check on the data for incorrect/out of limits entries. * * NOTE : CHANGE PATH TO FILES TO MATCH LOCATION OF FILES ON YOUR COMPUTER; * * INNAME is the name of the Excel file containing the data dictionary. * Note that the dictionary Excel sheet is assumed to be named Sheet1$. * OUTPUTNAME is the name of the resulting output SAS CODE file. * EXCELFILENAME is the name of the file containing the data * EXCELSHEET is the name of the sheet in the data Excel file * DSETNAME is the name of the SAS data file to be created by the SAS code file. * * See www.alanelliott.com/DDENTRY for more information *******************************************************************************; %LET INNAME=C:\SASMACRO\DDEXAMPLE.XLS; %LET OUTPUTNAME= C:\SASMACRO\MYSASCODE.SAS; %LET EXCELFILENAME=C:\SASMACRO\SURVEY.XLS; %LET EXCELSHEET=Survey; %LET DSETNAME=WORK.SURVEY; ************************************************************; %DDENTRY(DDNAME=&INNAME,OUTNAME=&OUTPUTNAME,ENAME=&EXCELFILENAME,SHEET=&EXCELSHEET,DSET=&DSETNAME); data _null_; file print; PUT; PUT; PUT "OPEN &OUTPUTNAME TO SEE SAS CODE FILE RESULTS."; run; * AFTER PROGRAM RUNS, OPEN THE FILE INPUT_INFO.SAS to see the results;