MY MACRO keeps crashing and stating that a non-number argument is found in the %SCAN. I am trying to go through a list of names of text files that are comma delimited and PROC IMPORT. I use this technique for lists delimited by spaces with no issues, I need the comma delimiter b/c (obviously) the text file names have spaces. %NameList = FFIEC CDR Call Schedule RCA, FFIEC CDR Call Schedule RCA, FFIEC CDR Call Schedule RCI; %macro RdTxttoSAS; %let i = 1; %let qtr = 06302012; %let name = %scan(%QUOTE(&NameList),&i,%STR(",")); %do %while (&qtr ne ); PROC IMPORT OUT=out.&NAME_&qtr DATAFILE= "..\BULKDATA\&NAME. &qtr..txt" DBMS=TAB REPLACE; GETNAMES=YES; DATAROW=3; GUESSINGROWS = MAX; RUN; %let i = %eval(&i+1); %let name = %scan(%QUOTE(&NameList),&i,%STR(",")); %end; %mend RdTxttoSAS;
... View more