Hello Forum,
I'm trying to create a macro that will import 12 months worth of data from 12 separate files. I receive error messages that symbolic reference MTH01 and MON01 cannot resolve. I also receive an error 22-322: syntax error, expecting one of the following: ;, (, DATAFILE, DATATABLE, DBMS, DEBUG, FILE, OUT....etc. I thought that a macro previously defined in a program could later be invoked within a macro?
Can someone please tell me what I'm doing wrong or what I can do to correct this? Thank you very much in advance.
~ Eric
rsubmit;
%let MTH01=%sysfunc(dequote("'%sysfunc(intnx(MONTH,%sysfunc(today()),-1),monyy7.)'"));
%let MON01=%sysfunc(dequote("'%sysfunc(intnx(MONTH,%sysfunc(today()),-1),mmyyn6.)'"));
endrsubmit;
%macro import(MONYY=,MMYY=);
PROC IMPORT OUT=tpt_lvt_his_&MMYY.
DATAFILE= "\\xxxxxxx\xxxxxxx\xxxxx\xxxx\xxxxx\xxxx\&MONYY.\TPT_ora_apples_&MMYY. (from zzz Sharepoint).xls"
DBMS=EXCEL REPLACE;
GETNAMES=YES; MIXED=NO; SCANTEXT=YES; USEDATE=YES; SCANTIME=YES;
RUN;
%mend;
%import (MONYY=&MTH01.,MMYY=&MON01.);