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
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/
|