I am have over 300 txt files to read; the only difference in the file name is the prefix date value. They range from 20190924 to 202000403. I am having a hard time with a macro and loop to read and append all 300 files. Below is are examples: PCALB110_20190924.txt PCALB110_20190925.txt PCALB110_20190926.txt .... PCALB110_20200403.txt I was trying to do something like; %macro STACK; %DO I='23sep2019'd %TO '26sep2019'd; data a; infile "/share/gsas_vnx_frl/Users/Carlos_Jimenez/Automation/PCS _ADDRESS_CHANGE/Daily/PCALB110_%sysfunc(compress(put(&I.,yymmdd10.),"-")).txt" LRECL=335 ENCODING="LATIN1" TERMSTR=CRLF DLM='7F'x MISSOVER DSD ; input NAME_BEFORE_CHANGE $ 1-40 NAME_AFTER_CHANGE $ 41-80 CARD_NUMBER $ 81-96 ACCOUNT_TYPE $ 97-99 ACCOUNT_NUMBER $100-109 OLD_ADDRESS $ 110-149 OLD_CITY_STATE_ZIP $ 150-189 NEW_ADDRESS $ 190-229 NEW_CITY_STATE_ZIP $ 230-269 ADDRESS_CHANGE_DATE $ 270-277 OPERATOR_ID $ 278-285 OPERATOR_NAME $ 286-325 ; DATE="&I"; format date mmddyy10.; run; proc append data=a out=stack force; run; %END; %MEND; But, it didn't work. Ideas??
... View more