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 (June 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 6 Jun 2005 22:38:42 -0400
Reply-To:     Ya Huang <ya.huang@AMYLIN.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ya Huang <ya.huang@AMYLIN.COM>
Subject:      Re: pipe to read a directory with space
Comments: To: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>

Thanks Richard, this is great.

On Mon, 6 Jun 2005 20:12:59 -0400, Richard A. DeVenezia <radevenz@IX.NETCOM.COM> wrote:

>Ya Huang wrote: >> Hi there, >> >> filename xx pipe "dir/b %sysfunc(pathname(WORK))\*.*"; >> >> data _null_; >> infile xx; >> input; >> put _infile_; >> run; >> >> The above doesn't work, and I believe the reason is that the >> directory name has spaces in it. >> On DOS window, I can type in >> dir/b "C:\WINNT\Temp\SAS Temporary Files\_TD2032\*.*" to get the list >> of the files, but how I can add double quote in the pipe? >> >> Thanks > > >Ya: > >Put two consecutive double quotes in the double quoted string to specify a >single double quote. > >filename xx pipe "dir/b ""%sysfunc(pathname(WORK))\*.*"""; > >You can also use the filename function > >%let fileref=xxx; >%let rc = %sysfunc(filename(fileref,DIR >"%sysfunc(pathname(WORK))\*.*",pipe)); >%let msg = %sysfunc(sysmsg()); >%put rc=&rc msg=&msg; > > >-- >Richard A. DeVenezia >http://www.devenezia.com/


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