home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!news.centerline.com!noc.near.net!mars.caps.maine.edu!maine.maine.edu!cunyvm!psuvm!auvm!PHPDLS1.EM.CDC.GOV!RJF2
- X-Delivery-Notice: SMTP MAIL FROM does not correspond to sender.
- Return-Path: rjf2@PHPDLS1.EM.CDC.GOV
- Encoding: 76 TEXT
- X-Mailer: Microsoft Mail V3.0 (beta-2)
- Message-ID: <2B09E13D@router.em.cdc.gov>
- Newsgroups: bit.listserv.sas-l
- Date: Wed, 18 Nov 1992 09:52:00 EST
- Reply-To: rjf2@PHPDLS1.EM.CDC.GOV
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: rjf2@PHPDLS1.EM.CDC.GOV
- Subject: reading multiple input files
- Lines: 67
-
- content : Information
- summary : two versions of code to read list of files
- rlse/platform: V6.07 / MVS
- Ron Fehd : SMTP:BitNet: <rjf2@phpdls1.em.cdc.gov>
- Centers for Disease Control
- 1600 Clifton Rd MS:G25 FAX : 404/639-1778
- Atlanta, GA 30333 USA phone: 404/639-1707
-
- To whom it may concern:
-
- There was a recent question about using a macro to read a series of files
- where there was a problem because there were sequentially-named files
- missing. I replied with a solution (not to the list, only to the questionner)
- that used MVS's proc SOURCE to create SAS text to be %INCLUDEd which
- could be used to read all the files.
-
- Today's mail refered to the use of the FILEVAR= option on the infile
- statement. Check page 387 of the SAS Language Reference V6, 1st Ed.
-
- The point I wish to illustrate with the following code is that, whereas the
- example uses cards to provide the NowRead variable, it is possible to create
- an SSD with the var NowRead (e.g., using MVS's proc SOURCE).
-
- //RJF2S JOB (JC00,B43),FEHD,CLASS=E,TIME=(,10),MSGCLASS=0
- //FILEVAR EXEC SAS
-
- FILENAME READTHIS 'RJF2.SAS.TOOLS';
- *FILENAME READTHIS 'RJF2.SAS.TOOLS(FILEVAR)';
-
- /* !*New*! and !*Improved*! **/
-
- DATA NOWREAD;
- length NowRead $ 72;
- input NowRead $;
- cards;
- RJF2.SAS.TOOLS(ALFA2NUM)
- RJF2.SAS.TOOLS(BIORYR5)
- RJF2.SAS.TOOLS(BIORYTHM)
- ;
-
- DATA FILEVAR;
- set NOWREAD;/*has var NowRead created in previous data-step*/
- infile READTHIS filevar=NowRead end = EndoFile;
- do until(EndoFile);
- input @1 line $char72.;
- output; end;
-
- proc PRINT;
- endSAS;
-
- /*Example from SAS Language, Reference, Version 6, First Edition, pg 387*/
-
- DATA FILEVAR;
- length NowRead $ 72;
- input NowRead $;/*from cards*/
- infile READTHIS filevar=NowRead end = EndoFile;
- do until(EndoFile);
- input @1 line $char72.;
- output; end;
- cards;
- RJF2.SAS.TOOLS(ALFA2NUM)
- RJF2.SAS.TOOLS(BIORYR5)
- RJF2.SAS.TOOLS(BIORYTHM)
- ;
- proc PRINT;
-
- happy crunching !*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
-