Don't you actually read the list SAS-L? About 3 weeks ago this subject was
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";
LENGTH FileName $ 100;
FILE "&StudyDir.\SASprog\Programs.SAS"; * This file will obtain the
IF UPCASE(FileName) NE UPCASE("ThisName..SAS"); * Exclude this program
IF UPCASE(FileName) NE "Programs.SAS"; * Exclude the result file;
FileName = "&StudyDir.\SASprog\"||TRIM(FileName);
PUT '%INCLUDE "' FileName '";';
%INCLUDE "&StudyDir.\SASprog\Programs.SAS"; * include all separate .SAS
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
> 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.
> In my directory I have two files:
> I want to do the list in my new table in SAS. Result:
> New Table
> Daniella Cruz