Is there a way, in SAS, to grab filenames (.txt files) from a directory (eg c:\\temp) and write them to a dataset? Or possibly to write them into a separate .txt. file?
I'm trying to find some examples online but haven't been able to locate anything.
The simplest way to do this is with a named pipe
, which you can then read from.
Eg:
filename mydir pipe 'dir c:\temp\*.txt /b';
data mydata;
infile mydir lrecl=150 truncover;
input @1 line $150.;
run;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.