LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2002, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 4 Feb 2002 17:47:12 -0500
Reply-To:   Bob Burnham <robert.a.burnham@DARTMOUTH.EDU>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Bob Burnham <robert.a.burnham@DARTMOUTH.EDU>
Organization:   Dartmouth College, Hanover, NH, USA
Subject:   Re: OT: UNIX and ls command

Kimberly_LeBouton@AHM.HONDA.COM (Kim LeBouton) writes:

+---------------------------------------------------------------- | I have one of my favorite FILENAME PIPE programs on UNIX that | uses the ls command for a particular directory. | | I'm now receiving the following error message: | | /usr/bin/ksh: /usr/bin/ls: 0403-027 The parameter list is too | long. +----------------------------------------------------------------

Hi Kim,

How about using the xargs command to break up the parameter list? Here is a snippet from the man page:

The xargs utility constructs a command line consisting of the utility and argument operands specified followed by as many arguments read in sequence from standard input as will fit in length and number constraints specified by the options. The xargs utility then invokes the constructed command line and waits for its completion. This sequence is repeated until an end-of-file condition is detected on standard input or an invocation of a constructed command line returns an exit status of 255.

So, to invoke this using SAS, you might try something like this:

filename dirlist pipe "echo * | xargs ls";

This will hopefully get you the same results that you have been getting before from ls, but without the error. A sample log is listed below:

1 options ps=60 ls=70 nocenter nodate nonumber; 2 3 filename dirlist pipe "echo * | xargs ls"; 4 5 data _null_; 6 length buffer $200; 7 infile dirlist truncover; 8 input buffer $; 9 put buffer; 10 run;

NOTE: The infile DIRLIST is: Pipe command="echo * | xargs ls"

ls-pipe.log ls-pipe.sas NOTE: 2 records were read from the infile DIRLIST. The minimum record length was 11. The maximum record length was 11. NOTE: DATA statement used: real time 0.130 seconds cpu time 0.023 seconds

Hope this helps and best regards,

Bob

-- Bob Burnham bburnham@dartmouth.edu http://www.dartmouth.edu/~bburnham


Back to: Top of message | Previous page | Main SAS-L page