02-08-2012 11:41 AM
EG: SAS Enterprise Guide 4.1 (126.96.36.1999)
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 (B 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
02-08-2012 12:01 PM
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).
02-08-2012 01:37 PM
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.