Date: Wed, 3 May 2000 16:22:18 +0200
Reply-To: Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Subject: Re: List files in SAS
Content-Type: text/plain
Daniella,
Don't you actually read the list SAS-L? About 3 weeks ago this subject was
discussed.
Building a file list with DIR, LS or whatever directory command in your OS,
is the solution. It is assumed that in the file name mask you take care for
including exactly the desired files, i.e. *.* if you have them all in a
separate directory. In the example below a pipe construct is applied to
catch all, but specific, .SAS programs to be executed consecutively. Adapt
it to meet your requirements.
FILENAME FileList PIPE "DIR /B &StudyDir.\SASprog\*.SAS";
DATA _NULL_;
LENGTH FileName $ 100;
INFILE FileList;
FILE "&StudyDir.\SASprog\Programs.SAS"; * This file will obtain the
intermediate result;
INPUT FileName;
IF UPCASE(FileName) NE UPCASE("ThisName..SAS"); * Exclude this program
file;
IF UPCASE(FileName) NE "Programs.SAS"; * Exclude the result file;
FileName = "&StudyDir.\SASprog\"||TRIM(FileName);
PUT '%INCLUDE "' FileName '";';
RUN;
%INCLUDE "&StudyDir.\SASprog\Programs.SAS"; * include all separate .SAS
files;
Regards - Jim.
--
Y. Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070
senior statistician, P.O. Box 1 fax. +31 412 407 080
head IT department 5350 AA BERGHEM IMRO TRAMARKO: a CRO
J.Groeneveld@ITGroups.com the Netherlands in clinical research
It is my job to keep my computer at work, but its job is to reveal my work.
> -----Original Message-----
> From: Daniella Priscila Cruz - Estagiaria SAS
> [SMTP:dpcruz@CENAPAD.UNICAMP.BR]
> Sent: Wednesday, May 03, 2000 3:58 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: List files in SAS
>
> Hello list,
> I want to know if I can to do a list in SAS with files that is in
> my directory.
> Example:
> In my directory I have two files:
> C:\dani\teste.sas
> teste1.sas
> I want to do the list in my new table in SAS. Result:
>
> New Table
> _____________________________
> teste
> teste1
>
>
> Thanks
> Daniella Cruz