Hi everybody, I'm new on SAS and I'm trying to import data from an excel sheet and I'm getting an error as seen below: NOTE: Line generated by the invoked macro "CAPTURE". 2 SCANTIME=YES; RUN; -------- 180 ERROR 180-322: Statement is not valid or it is used out of proper order. And this is my code: %macro capture(sheet,cd,lang); PROC IMPORT OUT= WORK.imp DATAFILE= "C:\SAS\Book1.xlsx" DBMS=XLSX REPLACE; RANGE="&sheet"; GETNAMES=YES; MIXED=NO; SCANTEXT=YES; USEDATE=YES; SCANTIME=YES; RUN; data imp; set imp; REC_TYPE=SUBSTR(CELLID,1,2); CELL=SUBSTR(CELLID,4,2); fscl_yr=2013; un_tp_cd=926; uu_tp='BBS_PUB '; own_mad_no=&cd.; bct_lang_cd=&lang.; run; data aar2013; set aar2013 imp; if OWN_MAD_NO=. THEN DELETE; run; %mend; %capture('Sheet1$',236587,0); %capture('Sheet2$',452658,2); %capture('Sheet3$',784587,1); %capture('Sheet4$',254145,0); %capture('Sheet5$',985687,0); So, I hope someone could give a hint about what is going on here. Thank you! Leo
... View more