10-08-2012 12:53 PM
I need helpnin a filename statement in sas.. I am using filename statement to read a file using filename statement with wildcards. Code... Filename `/dso/dsocln/hhhw/pers*.dat; However it can b poasible tht many file with same name so we want to.output the file name in sas output file. How to do.tbis? @ Alsi can we check d existence of the file matching the above naming pattern? need urgent help
10-09-2012 09:30 AM
I am using filename statement to read a file using filename statement with wildcards. However it can be possible tht many file with same name so we want to.output the file name in sas output/list file. How to do this? Also can we check d existence of a file matching the naming pattern?
The Filename=variable doesn't provide any option to print the input file name in sas output/list file.
Can you please elaborate?
Here is the sample code:
FILENAME PUA "/dso/dsocln/&srce./el/out/p_pers_uug*_F201201_*.txt" ;
data PERS ;
infile PUA recfm=v lrecl=413 truncover ;
@1 BLOCK $char387.
10-09-2012 09:54 AM
Personally I prefer to using 'pipe' plus 'filevar=' to tackle the problems like this. For infile statement and wildcard, please refer to this papter:
and go to the section:
"ACCESSING FILE NAMES WITH ‘WILD CARDS’