Hello all, I am having an issue with trying to use proc import in a macro for an .xlsx Excel file. Below is my code and the error message from the log. 60 %macro pharma (a,b); 61 proc import out = &a 62 datafile = "C:\SUM_2016\SUM2016_HW\project2\&b" 63 dbms = xlsx replace; 64 getnames = yes; 65 mixed = yes; 66 datarow = 2; 67 run; 68 %mend pharma; 69 %pharma (project2, project2.xlsx) NOTE: The previous statement has been deleted. NOTE: The previous statement has been deleted. NOTE: Line generated by the invoked macro "PHARMA". 1 getnames = yes; mixed = yes; datarow = 2; run; ----- 180 ERROR 180-322: Statement is not valid or it is used out of proper order. My question is, why is SAS telling me getnames=yes; mixed=yes; datarow=2; is not valid or is used out of proper oder? Can you not use these statements when importing a .xlsx file? When I take out getnames=yes; mixed=yes; datarow=2 and run the program, it runs correctly with the below log. Any help in understanding this will be very much appreciated. 53 %macro pharma (a,b); 54 proc import out = &a 55 datafile = "C:\SUM_2016\SUM2016_HW\project2\&b" 56 dbms = xlsx replace; 57 run; 58 %mend pharma; 59 %pharma (project2, project2.xlsx) NOTE: The import data set has 5 observations and 27 variables. NOTE: WORK.PROJECT2 data set was successfully created. NOTE: PROCEDURE IMPORT used (Total process time): real time 0.86 seconds cpu time 0.04 seconds
... View more