Hello all-
I am well acquainted the use of pipes-
However is there an alt method of importing filenames?
I ask due to the fact that at some point I will have to port a program to EG.
Yes I know that I can change the registry however I don't have such permissions and even if I do-I may not have the permissions on the server.
Thanks.
Lawrence
To build on data_null_'s reply, here's something to get you started.
data _null_;
rc = filename( 'mydir', 'c:\temp' );
did = dopen( 'mydir' );
count = dnum( did );
do i = 1 to count;
filenm = dread( did, i );
putlog filenm;
end;
run;
Note that the dread function returns not only file names but directories too. You'll have to account for that.
See function category External Files
To build on data_null_'s reply, here's something to get you started.
data _null_;
rc = filename( 'mydir', 'c:\temp' );
did = dopen( 'mydir' );
count = dnum( did );
do i = 1 to count;
filenm = dread( did, i );
putlog filenm;
end;
run;
Note that the dread function returns not only file names but directories too. You'll have to account for that.
Allowing shell escape (xcmd) is a simple tick in a box using SMC. The tick-box is "hidden" in the Workspace Server Properties under "Options/Advanced Options".
So it's a SAS Metadata change and not some client sided change of registry information.
Else: What data _null_; suggests. I recall several discussions and solutions around this question here in these forums. Searching with keywords "directory list" will bring up some of them.
May be this sample code will help: http://support.sas.com/kb/25/074.html
Thanks all!
Esp SAS Bigot-Answer helped immensely.
Lawrence
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.