Desktop productivity for business analysts and programmers

Read Filenames Off Of Corporate Share Drive From EG

Posts: 24

Read Filenames Off Of Corporate Share Drive From EG

EG: SAS Enterprise Guide 4.1 (

I need to read in *.pdf file names off of our corporate share drives from EG / UNIX and create a SAS Dataset with the names.

The mapped share I need to connect to from EG has this type of string when mapped: abcdefghij on 'Shared File Server (AAAAA-bbb-999)' (That is how it looks mapped to my B: Drive)

There is a folder structure under that that looks like ... B:\Level1\Level2\Level3\*.pdf

Below code is what I have for PC SAS where I have access to the Mapped Drive (BSmiley Happy and it works perfect.

I need to connect to the Share Drive and be able to do the same from EG running on the UNIX box..

Below Works Fine:

%let dirname = B:\scorecards\12-2011_Data\Scorecards_Dec11_Data_V1;
filename DIRLIST pipe "dir /B &dirname\*.pdf";

data dirlist ;
     length fname $256;
     infile dirlist length=reclen ;
     input fname $varying256. reclen ;

When I run the above code on EG I get a DirList SAS DataSet with the following value in the fname field: /bin/ksh: dir:  not found

Any ideas?


Trusted Advisor
Posts: 2,127

Read Filenames Off Of Corporate Share Drive From EG


EGuide is running on your PC, but your SAS server is in the Unix environment.  You need to rewrite the dirname to follow Unix conventions (not the PC-mapped drive letter) and change the 'dir' to an "ls" (also to follow the Unix conventions). 

Doc Muhlbaier


Super User
Super User
Posts: 8,267

Read Filenames Off Of Corporate Share Drive From EG

If B: is mapped to "abcdefghij on 'Shared File Server (AAAAA-bbb-999)"

Then from the PC you should be able to refer to it as \\AAAAA-bbb-999\abcdefhij\ instead of B:\.

But from you Unix server there is probably a mount point that would make this visable from the Unix processes.  They might have mounted as something like /net/AAAAA-bbb-999/abcdefghij/ , but you need to check with the Unix admin to see exactly how to find the same data.

Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation