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
Any Help???
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.
If you are on SAS 9.4, then try to leverage the ZIP access method.
Otherwise, you will have to resort the third party software, here is a good paper:
http://www2.sas.com/proceedings/sugi31/155-31.pdf
Good Luck,
Haikuo
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.