BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
LB
Quartz | Level 8 LB
Quartz | Level 8

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

1 ACCEPTED SOLUTION

Accepted Solutions
FloydNevseta
Pyrite | Level 9

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.

View solution in original post

4 REPLIES 4
data_null__
Jade | Level 19

See function category External Files

FloydNevseta
Pyrite | Level 9

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.

Patrick
Opal | Level 21

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

LB
Quartz | Level 8 LB
Quartz | Level 8

Thanks all!

Esp SAS Bigot-Answer helped immensely.

Lawrence

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2720 views
  • 4 likes
  • 4 in conversation