02-02-2015 08:56 AM
I am trying to read the files from the folder on Linux using PIPE. There are currently 2 files (ABC_*.zip) in the folder. But when I tried to use the following code but it does not work. What may be wrong in the code? %let extl_dir=/PROD/PGM/; filename zl pipe "ls &extl_dir.ABC_*.zip"; data ziplist_a; infile pl end=last; length path $200 zipnm $50 filedt $15; input path $; zipnm=scan(path,-1,"/"); filedt=scan(scan(path,-1,"_"),1,"."); call symput('zip'||left(_n_), zipnm); call symput('path'||left(_n_), path); call symput('filedt'||left(_n_),filedt); if last then call symput('num_zip',_n_); run; NOTE: Numeric values have been converted to character values at the places given by: (Line)Column). 97:25 98:26 99:28 100:36 NOTE: The infile ZL is: Unnamed Pipe Access Device, PROCESS=ls /PROD/PGM/ABC_*.zip, RECFM=V,LRECL=256 Stderr output: 'ls' is not recognized as an internal or external command, operable program or batch file. NOTE: 0 records were read from the infile PL. NOTE: The data set WORK.ZIPLIST_A has 0 observations and 3 variables. NOTE: DATA statement used (Total process time): real time 0.07 seconds cpu time 0.03 seconds
02-02-2015 10:10 AM
This is a community, not a free support site. If you need immediate help, hire a consultant.
Also, it's easier to help if you provide logs that are readable. Have them in an attachment if you got problem pasting them into the text input field in the browser.
So how are you executing this code? From a Linux shell command prompt, Enterprise Guide connection, or?
Since it seems you are not executing the pipe in Linux.
To narrow down the problem, test to put the path explicitly in the pipe string (avoid the macro variable). The test the exact same command on a Linux shell prompt.
02-02-2015 10:08 AM