|Date: ||Thu, 16 Dec 1999 16:17:43 -0500|
|Reply-To: ||Howard Schreier <Howard_Schreier@ITA.DOC.GOV>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Howard Schreier <Howard_Schreier@ITA.DOC.GOV>|
|Subject: ||Re: Reading in multiple files of the same extension from a single
|Content-Type: ||text/plain; charset=US-ASCII|
I've used this wildcard technique. Recently had a bit of trouble though when the filenames had no extension. To get SAS to process the files, I ended up renaming them ("foo1" became "foo1.dat" etc.). This was using SAS 6.12 TS020 and Win 95.
> From: Peter Crawford <peter.crawford@DB.COM>
> suppose the filevar option gets a bit top heavy (it is quite memory
> intensive when you have lots of datasets)
> just try global naming (something like)
> infile 'my*.txt' truncover file=filenam;
> or where you already have the meta data of the physical names required,
> in a sas data set, populate a macro variable with the names wanted using
> sql code like (untested!)
> proc sql noprint;
> select distinct quote( physName ) into :wantname separated by ' '
> from meta.data /* or which-ever */
> where <it is really wanted>;
> then your infile statement might be
> infile ( &wantname ) truncover filename = filenam
> ls=10000 /* larger than the largest */ ;
> the infile option FileName= allows you to know from which text file the
> infile is reading at run time.