home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / bit / listserv / sasl / 3414 < prev    next >
Encoding:
Text File  |  1992-07-24  |  2.1 KB  |  46 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Newsgroups: bit.listserv.sas-l
  3. Path: sparky!uunet!darwin.sura.net!paladin.american.edu!auvm!uvvm!klassen
  4. References:  <23JUL92.12634629.0140.MUSIC@SIUEMUS.BITNET>
  5. Message-ID: <92205.150000KLASSEN@UVVM>
  6. Date:         Thu, 23 Jul 1992 15:00:00 PDT
  7. Reply-To:     Melvin Klassen <KLASSEN@UVVM.BITNET>
  8. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  9. Comments:     Warning -- original Sender: tag was NETNEWS@UVVM.UVIC.CA
  10. From:         Melvin Klassen <KLASSEN@UVVM.BITNET>
  11. Subject:      Re: Set Statement
  12. Lines: 32
  13.  
  14. Todd Shook <DPTS@SIUEMUS> writes:
  15. >      I need to know if there is a way  with the 'SET Statement' that
  16. >I can reference a dataset name without including the  member types.
  17. >Let me explain my problem.  I have a SAS dataset with 1 to 16 members in it.
  18. >I never know exactly how many members are in the dataset at a time
  19. >(ie. //batch111    dd  dsn=ssg.sas.file
  20. >                                    members=memb01, memb02, mem08 ....
  21. >In my batch SAS program (ver 6.06) I have the following code.
  22. >              Data applic;
  23. >                   Set batch111.?????;   This is where I don't want to
  24. >                                         have to put the member name in.
  25. >                                         I want to select them all.
  26. Try the following:
  27.  /* Tell PROC DATASETS to write the directory to a SAS dataset */
  28.    PROC DATASETS LIBRARY=BATCH111 NOLIST;
  29.         CONTENTS DATA=_ALL_ DIRECTORY NOPRINT
  30.         OUT=WORK.WORK1;
  31.    RUN;
  32.  /* Use the DATA step to generate SAS statements. */
  33.    DATA _NULL_;
  34.         FILENAME OUTFILE 'system-dependent-stuff';
  35.         FILE     OUTFILE NOPRINT;
  36.         SET WORK1(KEEP=MEMNAME);
  37.                     BY MEMNAME;
  38.         IF       FIRST.MEMNAME THEN DO;
  39.             /* Generate a 'PROC PRINT' statement for each existing member */
  40.             PUT "TITLE 'Output for member="     MEMNAME "';  "       ;
  41.             PUT 'PROC PRINT DATA= MAPS.'     || MEMNAME || ';'       ;
  42.             END;
  43.    RUN;
  44. OPTIONS OBS=2;       /* For debugging, limit the amount of output */
  45. %INCLUDE OUTFILE;    /* Tell SAS to process the newly-generated statements */
  46.