Date: Mon, 28 Jan 2008 06:52:53 -0800
Reply-To: Paige Miller <paige.miller@KODAK.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Paige Miller <paige.miller@KODAK.COM>
Subject: Re: Pipe when file location has spaces
Content-Type: text/plain; charset=ISO-8859-1
On Jan 28, 9:30 am, Peter <crawfordsoftw...@gmail.com> wrote:
> On 28 Jan, 13:36, Paige Miller <paige.mil...@kodak.com> wrote:
> > I have been using pipes to read the list of files in a Windows folder
> > on a server.
> > for example
> > libname mydir pipe "\\server\share\foldername";
> > data dirlist;
> > infile mydir pad missover;
> > ...
> > run;
> > was successful at reading the contents of the folder.
> > Now, the server admin has changed the share name to a share that has a
> > space in the name.
> > No longer does the pipe work, and I can't figure out what to change to
> > make the pipe work when there is a space in the share name. Help!
> Hi Paige
> have you tried embedding the path in double quotes for the server, and
> single-quoting that for the libname statement, like
> libname mydir pipe '"\\server\share\foldername"';
Actually, I tried that, seems to work fine. So let's move on to the
next problem. Suppose the folder name is a macro variable. Now what?
Single quotes don't seem to work. Also, let me correct an error in my
original post, filename instead of libname.
filename mydir pipe 'dir "\\server\share with spaces\foldername"';
works. However, if I want a macro variable,
filename mydir pipe 'dir "&dirname"';
doesn't work. How do I make that work?