I am trying to export data from a clinical database (OnCore) and analyze it in SAS. The database exports data as multiple excel files rather than one large dataset. This macro code is supposed to import all the the raw excel files into SAS and I cannot figure out why there is an error message within my code. It seems to have an issue when I specify the library name "sasd" for the file name. %MACRO formnames();
%DO i=1 %TO &numforms;
data _null_;
set formnames;
if n= &i;
call symput('Oncore', TRIM(Oncore));
call symput('SAS', TRIM(SAS));
run;
%put &Oncore;
PROC IMPORT OUT= sasd._raw_&sas
DATAFILE= "&sasd\&oncore.xlsx"
DBMS=XLSX REPLACE;
SHEET="&Oncore";
GETNAMES=YES;
RUN;
%END;
%MEND;
%formnames();
... View more