Hi Scott Thanks for the speedy response. I added the notation that you indicated to the code and it still doesn't work as required. The full code is: %let import_file_sub = 'F:\TEST\Data\Submission\*.txt'; %let import_file_corr='F:\TEST\Data\Corrections\*.txt'; data importA; infile &import_file_sub truncover LRECL = 5000 firstobs=2; input @1 Chart $6. @7 Acct $6. @13 Sex $1. @14 Age $2. @16 DataA $2. @18 DataB $2. @20 DataC $2.; run; filename files pipe 'dir /b "F:\TEST\Data\Corrections\*.txt" /o:N'; data _null_; infile files truncover end=last; input fname $5.; i+1; call symput("fname"||trim(left(put(i,8.))),trim(fname)||".txt"); if last then call symput("total",trim(left(put(i,8.)))); call symput("fnamedate"||trim(left(put(i,8.))),substr(trim(fname),15,8)); run; %macro imports; %do i=1 %to &total.; data nxg1; infile "F:\TEST\Data\Corrections\&&fname&i" dlm='1C'x truncover LRECL = 5000 firstobs=2; input @1 Chart $6. @7 Acct $6. @13 Sex $1. @14 Age $2. @16 DataA $2. @18 DataB $2. @20 DataC $2.; run; proc sort data=importa; by chart acct; run; proc sort data=nxg1; by chart acct; run; data test; update importa nxg1; by chart acct; run; %end; %MEND; %IMPORTS; As per the last notation, I wish each file to append to the main file in sequence so that if an abstract is edited more than once from the original, then the edits will be applied correctly. In this test program, there are only a few fields but the real data has hundreds of fields and I won't know which ones have been edited to indicate that in the program. So it just has to overwrite the original EACH time. Any assistance greatly appreciated. Thanks.
... View more