|
Have a look at the following example:
data a;
length file $80;
rc=filename("dir","d:\");
d=dopen("dir");
n=dnum(d);
do i=1 to n;
file=dread(d,i);
put file=;
end;
run;
That might be something you can adapt to your needs.
Gerhard
On Thu, 30 Aug 2007 12:17:37 +0530, Sai Kumar Korrapati (ETS)
<saikumark@HCL.IN> wrote:
>You can use DOS commands in sas in order to get the file names in a
>folder
>
>Use PIPE command with DOS command , pump the file names to some variable
>using Filename option in sas
>
>In infile statement you can replace the defined filename option .
>
>
>Thanks
>sai
>
>-----Original Message-----
>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
>boulmo
>Sent: Thursday, August 30, 2007 12:08 PM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: how can i get the name of an external file ?
>
>Hi!
>
>I have a folder containing several files with the same name and
>incremented. Like
>
>res01.txt
>res02.txt
>res03.txt
>
>And i need to get the name of the last file (res03.Txt here for
>instance) in one variable
>
>Someone would have an idea ?
>Thanks
>Pierre
>
>DISCLAIMER:
>-----------------------------------------------------------------------------------------------------------------------
>
>The contents of this e-mail and any attachment(s) are confidential and
intended for the named recipient(s) only.
>It shall not attach any liability on the originator or HCL or its
affiliates. Any views or opinions presented in
>this email are solely those of the author and may not necessarily reflect
the opinions of HCL or its affiliates.
>Any form of reproduction, dissemination, copying, disclosure, modification,
distribution and / or publication of
>this message without the prior written consent of the author of this e-mail
is strictly prohibited. If you have
>received this email in error please delete it and notify the sender
immediately. Before opening any mail and
>attachments please check them for viruses and defect.
>
>-----------------------------------------------------------------------------------------------------------------------
|