Date: Tue, 7 May 2002 17:28:03 +0100
Reply-To: Peter Crawford <peter.crawford@DB.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Peter Crawford <peter.crawford@DB.COM>
Subject: Re: List of files
Content-type: text/plain; charset=iso-8859-1
and here is a short process to do the same on winXX
filename dirs pipe 'dir /b /ad /s ';
data;
infile dirs length = l;
input dir $varying256. l;
run;
For documentation on the /b /ad /s
go to a dos prompt and type
dir /?
Datum: 06/05/2002 14:12
An: SAS-L@LISTSERV.UGA.EDU
Antwort an: "Goldman, Brad (AT-Atlanta)" <Brad.Goldman@AUTOTRADER.COM>
Betreff: List of files
Nachrichtentext:
> Date: Sun, 5 May 2002 15:36:04 -0400
> From: StatDept <StatDept@YAHOO.COM>
> Subject: List of files
>
> How do you get a listing of folders in a directory into a text file?
>
> -SH
Hi SH,
I am going to jump to the conclusion that you want to get the listing into a
text file in order that you can read the results into a SAS dataset. If
this is true, then there are more elegant methods than creating a text file.
One is to use the pipe command. The following example is based in Unix, but
should work with Windows syntax also.
filename dirlist pipe "ls &dailydir";
data dclist emlist;
infile dirlist;
length dataname dsn $25;
input @1 dsn;
if substr(dsn,1,2)='dc' then output dclist;
if substr(dsn,1,2)='em' then output emlist;
run;
HTH,
Brad
--
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.