Hi,
I'm having problems with some code. I read in 6 text files using a wildcard. There are many more files in the root folder that are not read in.
I need to write the filename of each of the files that are read in into a new column in the dataset.
Any help would be greatly received.
The code I used to read in the files is below:
-----------------------------------------------------------
dm log 'clear' output;
%let month=JAN09;
%let rootfolder=Y:\Tubbsy\;
%let staging=C:\Temp\Lookup\;
%let folder=SCT;
%let dlimit=',';
libname tmploc "&staging&folder";
data tmploc.lookup;
infile "&staging&folder\*.TXT" dsd truncover dlm=&dlimit;
length temp $1 pcode1 $5 pcode2 $5;
input temp$ pcode1$ pcode2$;
postcode=trim(pcode1)||' '||trim(pcode2);
drop temp;
run;
-----------------------------------------------------------
Thanks in advance.
Regards
Tubbsy123
I'm having problems with some code. I read in 6 text files using a wildcard. There are many more files in the root folder that are not read in.
I need to write the filename of each of the files that are read in into a new column in the dataset.
Any help would be greatly received.
The code I used to read in the files is below:
-----------------------------------------------------------
dm log 'clear' output;
%let month=JAN09;
%let rootfolder=Y:\Tubbsy\;
%let staging=C:\Temp\Lookup\;
%let folder=SCT;
%let dlimit=',';
libname tmploc "&staging&folder";
data tmploc.lookup;
infile "&staging&folder\*.TXT" dsd truncover dlm=&dlimit;
length temp $1 pcode1 $5 pcode2 $5;
input temp$ pcode1$ pcode2$;
postcode=trim(pcode1)||' '||trim(pcode2);
drop temp;
run;
-----------------------------------------------------------
Thanks in advance.
Regards
Tubbsy123