The following code is read in the mobile phone bill from the excel file and does a lot of cleaning / reporting.
%LET month = March; .......... PROC IMPORT OUT = PHONE.marchmin DATAFILE = "D:\Data\cellphone\MarchBill.xls" DBMS = EXCEL REPLACE; SHEET = "Calls$"; GETNAMES = YES; MIXED = YES; SCANTEXT = YES; USEDATE = YES; SCANTIME = YES; RUN;
To make my life easier, I'm trying to use a macro variable to update all the links for March. My initial idea below does not work.
%LET month = March; ....... PROC IMPORT OUT = PHONE.&monthmin DATAFILE = "D:\Data\cellphone\&monthBill.xls" DBMS = EXCEL REPLACE; SHEET = "Calls$"; GETNAMES = YES; MIXED = YES; SCANTEXT = YES; USEDATE = YES; SCANTIME = YES; RUN;
It produces the following error:
WARNING: Apparent symbolic reference MONTHMIN not resolved. 1551 PROC IMPORT OUT= PHONE.&monthmin - 22 ERROR 22-322: Syntax error, expecting one of the following: ;, (, DATAFILE, DATATABLE, DBMS, FILE, OUT, REPLACE, TABLE.
How to get this link to a month variable for the correct update?
source share