01-04-2013 02:20 PM
I can get you started. Unfortunately, I don't have access to a Unix machine to check out the format of the directory listing.
1. Take a copy of the Windows version of the macro.
2. Change line
%if %upcase( &SUBDIR ) = Y %then %let SUBDIR = /s ; %else %let SUBDIR = ;
%if %upcase( &SUBDIR ) = Y %then %let SUBDIR = -R ; %else %let SUBDIR = ;
This changes the option correctly to ask for a subdirectory listing in Unix.
3. change line
filename DIRLIST pipe "dir /-c /q &SUBDIR /t:c ""&PATH""" ;
filename DIRLIST pipe "ls -l &SUBDIR ""&PATH""" ;
This will mostly change the Windows "dir" command to the Unix "ls" command, which is the equivalent. I'm not sure if the quote structure around the directory name will work the same...you'll need to test that.
4. This should get you down to the section of code beginning with
input line $varying1024. reclen ;
which is the statement that reads the directory info. I suggest you just comment out the rest of this step for now, which should result in one record, with a variable "line", for every line of your directory result. You can then use this example to recode the rest of the step to accomodate the different Unix format.