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