Date: Fri, 20 Jun 2003 14:38:25 -0400
Reply-To: Mike Rhoads <RHOADSM1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mike Rhoads <RHOADSM1@WESTAT.COM>
Subject: Re: FileExists for PDS style filename in Windows ?
Content-Type: text/plain
Richard,
I would probably try using the PATHNAME function to get the physical name of
the directory represented by the fileref, then concatenate the "member name"
part (info.txt) to the end of that (with an appropriate delimiter in between
if necessary) as the argument to FILEEXIST.
Mike Rhoads
Westat
RhoadsM1@Westat.com
-----Original Message-----
From: Richard A. DeVenezia [mailto:radevenz@IX.NETCOM.COM]
Sent: Friday, June 20, 2003 10:20 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: FileExists for PDS style filename in Windows ?
In windows suppose I have a file
c:\temp\myData\info.txt
containing some data such as
1 2 3
pds-style filenaming is [ <fileref> ( <filename> ) ], where filename should
exist in the folder fileref points to I can use pds-style naming to read
from info.txt
filename myData 'c:\temp\myData\';
data abc;
infile myData(info.txt);
input a b c;
run;
But the FileExist() and FileRef() functions do not like the pds-style naming
%put Exists: %sysfunc (FileExist (myData(info.txt)));
%put Exists: %sysfunc (FileRef (myData(info.txt)));
Exists: 0
Exists: 20004
Any suggestions on how to check existence of file when given pds-style
filename ?
--
Richard A. DeVenezia, http://www.devenezia.com