BookmarkSubscribeRSS Feed
pp2014
Fluorite | Level 6

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

3 REPLIES 3
pp2014
Fluorite | Level 6

Any Help???

LinusH
Tourmaline | Level 20

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.

Data never sleeps
Haikuo
Onyx | Level 15

If you are on SAS 9.4, then try to leverage the ZIP access method.

» FILENAME ZIP

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 826 views
  • 0 likes
  • 3 in conversation