home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / bit / listserv / sasl / 5084 < prev    next >
Encoding:
Text File  |  1992-11-18  |  2.7 KB  |  83 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!news.centerline.com!noc.near.net!mars.caps.maine.edu!maine.maine.edu!cunyvm!psuvm!auvm!PHPDLS1.EM.CDC.GOV!RJF2
  3. X-Delivery-Notice:  SMTP MAIL FROM does not correspond to sender.
  4. Return-Path: rjf2@PHPDLS1.EM.CDC.GOV
  5. Encoding: 76 TEXT
  6. X-Mailer: Microsoft Mail V3.0 (beta-2)
  7. Message-ID: <2B09E13D@router.em.cdc.gov>
  8. Newsgroups: bit.listserv.sas-l
  9. Date:         Wed, 18 Nov 1992 09:52:00 EST
  10. Reply-To:     rjf2@PHPDLS1.EM.CDC.GOV
  11. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  12. From:         rjf2@PHPDLS1.EM.CDC.GOV
  13. Subject:      reading multiple input files
  14. Lines: 67
  15.  
  16. content      : Information
  17. summary      : two versions of code to read list of files
  18. rlse/platform: V6.07 / MVS
  19. Ron Fehd     :                SMTP:BitNet:    <rjf2@phpdls1.em.cdc.gov>
  20.               Centers for Disease Control
  21.               1600 Clifton Rd  MS:G25         FAX  : 404/639-1778
  22.               Atlanta, GA 30333  USA          phone: 404/639-1707
  23.  
  24. To whom it may concern:
  25.  
  26. There was a recent question about using a macro to read a series of files
  27. where there was a problem because there were sequentially-named files
  28. missing. I replied with a solution (not to the list, only to the questionner)
  29. that used MVS's proc SOURCE to create SAS text to be %INCLUDEd which
  30. could be used to read all the files.
  31.  
  32. Today's mail refered to the use of the FILEVAR= option on the infile
  33. statement. Check page 387 of the SAS Language Reference V6, 1st Ed.
  34.  
  35. The point I wish to illustrate with the following code is that, whereas the
  36. example uses cards to provide the NowRead variable, it is possible to create
  37. an SSD with the var NowRead (e.g., using MVS's proc SOURCE).
  38.  
  39. //RJF2S    JOB (JC00,B43),FEHD,CLASS=E,TIME=(,10),MSGCLASS=0
  40. //FILEVAR  EXEC SAS
  41.  
  42. FILENAME READTHIS 'RJF2.SAS.TOOLS';
  43. *FILENAME READTHIS 'RJF2.SAS.TOOLS(FILEVAR)';
  44.  
  45. /* !*New*! and !*Improved*! **/
  46.  
  47. DATA NOWREAD;
  48.   length NowRead $ 72;
  49.   input  NowRead $;
  50. cards;
  51. RJF2.SAS.TOOLS(ALFA2NUM)
  52. RJF2.SAS.TOOLS(BIORYR5)
  53. RJF2.SAS.TOOLS(BIORYTHM)
  54. ;
  55.  
  56. DATA FILEVAR;
  57.   set NOWREAD;/*has var   NowRead created in previous data-step*/
  58.   infile READTHIS filevar=NowRead    end = EndoFile;
  59.   do until(EndoFile);
  60.     input @1 line $char72.;
  61.     output;                                                         end;
  62.  
  63. proc PRINT;
  64.  endSAS;
  65.  
  66.  /*Example from SAS Language, Reference, Version 6, First Edition, pg 387*/
  67.  
  68. DATA FILEVAR;
  69.   length NowRead $ 72;
  70.   input  NowRead $;/*from cards*/
  71.   infile READTHIS  filevar=NowRead    end = EndoFile;
  72.   do until(EndoFile);
  73.     input @1 line $char72.;
  74.     output;                                                         end;
  75. cards;
  76. RJF2.SAS.TOOLS(ALFA2NUM)
  77. RJF2.SAS.TOOLS(BIORYR5)
  78. RJF2.SAS.TOOLS(BIORYTHM)
  79. ;
  80. proc PRINT;
  81.  
  82. happy crunching !*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!*!
  83.