home *** CD-ROM | disk | FTP | other *** search
- Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
- Path: sparky!uunet!paladin.american.edu!auvm!LOBBY.TI.COM!RSNYDER
- X-Mailer: ELM [version 2.2 PL16]
- Message-ID: <9207231710.AA00799@ti.com>
- Newsgroups: bit.listserv.sas-l
- Date: Thu, 23 Jul 1992 12:10:15 CDT
- Reply-To: "R. Snyder" <rsnyder@LOBBY.TI.COM>
- Sender: "SAS(r) Discussion" <SAS-L@UGA.BITNET>
- From: "R. Snyder" <rsnyder@LOBBY.TI.COM>
- Subject: V6.07, HP300 Macro Problem
- Comments: To: sas-l@uga.cc.uga.edu
- Lines: 239
-
- Hello everyone!
-
- I have a situation (it woild be a problem if I couldn't get around it) that
- has me completely stumped. Maybe some of you Macro Language gurus can give
- me a clue.
-
- The situation:
-
- The following works fine.
-
-
- /*---------------------------- PAVEWAY FIS ------------------------------*/
- /* */
- /* MODULE: tstdata.sas */
- /* */
- /* AUTHOR: Bob Snyder */
- /* */
- /* LANGUAGE: SAS / SAS Macro language */
- /* */
- /* ABSTRACT: This module stores AT test data to the local database. It */
- /* also triggers SPC analysis of the data. */
- /* */
- /*-----------------------------------------------------------------------*/
-
- %macro tstdata;
-
- /* Macro Variable Declarations */
-
- %local dupfile;
-
- /* Check archive.event for a duplicate filename. */
- %checkdup( event );
-
- %if &dupfile eq 0 %then
- %do;
-
- /* Indicate that data storage has begun. */
- %display DataIn.storing noinput;
-
- /* Get the next event number from archive.events. */
- %getevent;
-
- /* Update the event number in the working data set. */
- %upevent;
-
- /* Retrieve the dictionary entry for the test software. */
- %getentry;
-
- /* Create a view that joins the data to the dictionary. */
- %readdict; /* Create work.params */
-
- /* Perform data input tasks common to all test sets. */
-
- proc append out=archive.event new=work.newevnt;
- proc append out=archive.test new=project.testsin;
- proc append out=archive.param new=work.params;
-
- /* Do the required data input tasks for the particular test set. */
-
- %if %upcase( &testset ) eq &tsname1 %then
- %do;
- proc append out=archive.ofpdata new=project.ofpin;
- run;
- %end;
- %else %if %upcase( &testset ) eq &tsname2 %then
- %do;
- proc append out=archive.ofpdata new=project.ofpin;
- run;
- %end;
- %else
- %do;
- run;
- %end;
-
- /* Archive the test data to the server. */
- /* %archtst; */
-
- %end;
- %else
- %do;
- %display DataIn.duplicat;
- %whenerr;
- %end;
-
- %mend tstdata;
-
- ============================================================================
-
- The following blows up.
-
-
- /*---------------------------- PAVEWAY FIS ------------------------------*/
- /* */
- /* MODULE: tstdata.sas */
- /* */
- /* AUTHOR: Bob Snyder */
- /* */
- /* LANGUAGE: SAS / SAS Macro language */
- /* */
- /* ABSTRACT: This module stores AT test data to the local database. It */
- /* also triggers SPC analysis of the data. */
- /* */
- /*-----------------------------------------------------------------------*/
-
- %macro tstdata;
-
- /* Macro Variable Declarations */
-
- %local dupfile;
-
- /* Check archive.event for a duplicate filename. */
- %checkdup( event );
-
- %if &dupfile eq 0 %then
- %do;
-
- /* Indicate that data storage has begun. */
- %display DataIn.storing noinput;
-
- /* Get the next event number from archive.events. */
- %getevent;
-
- /* Update the event number in the working data set. */
- %upevent;
-
- /* Retrieve the dictionary entry for the test software. */
- %getentry;
-
- /* Create a view that joins the data to the dictionary. */
- %readdict; /* Create work.params */
-
- %makesets( archive );
-
- /* Archive the test data to the server. */
- /* %archtst; */
-
- %end;
- %else
- %do;
- %display DataIn.duplicat;
- %whenerr;
- %end;
-
- %mend tstdata;
-
- ------------------------------------------------------------------------------
-
-
- %macro makesets( target );
- %put ******************************** tolocal;
- /* Retrieve the dictionary entry for the test software. */
- %getentry;
-
- /* Create a view that joins the data to the dictionary. */
- %readdict; /* Create work.params */
-
- /* Perform data input tasks common to all test sets. */
-
- proc append out=&target..event new=work.newevnt;
- proc append out=&target..test new=project.testsin;
- proc append out=&target..param new=work.params;
-
- /* Do the required data input tasks for the particular test set. */
-
- %if %upcase( &testset ) eq &tsname1 %then
- %do;
- proc append out=&target..ofpdata new=project.ofpin;
- run;
- %end;
- %else %if %upcase( &testset ) eq &tsname2 %then
- %do;
- proc append out=&target..ofpdata new=project.ofpin;
- run;
- %end;
- %else
- %do;
- run;
- %end;
-
- mend makesets;
-
- ===========================================================================
-
- During the execution of the macro readdict the following error message is
- written to the SAS log over and over again forever:
-
- ERROR: Invalid %DISPLAY option .
-
- The macro readdict is included for reference.
-
-
- /*---------------------------- PAVEWAY FIS ------------------------------*/
- /* */
- /* MODULE: readdict.sas */
- /* */
- /* AUTHOR: Bob Snyder */
- /* */
- /* LANGUAGE: SAS / SAS Macro language */
- /* */
- /* ABSTRACT: This module joins the dictionary to the test data to supply */
- /* information not supplied by the test set. While this is a */
- /* de-normalization it will make the data easier to read and query. */
- /* */
- /*-----------------------------------------------------------------------*/
-
- %macro readdict;
-
- proc sql;
-
- create view work.params as
-
- select data.eventno, data.filename, dict.testno, dict.subtest,
- data.paramno, dict.xrefno, data.measid, data.val,
- case data.nom
- when . then dict.nom
- else data.nom
- end as nom,
- case data.ll
- when . then dict.lsl
- else data.ll
- end as ll,
- case data.ul
- when . then dict.usl
- else data.ul
- end as ul,
- data.p_f
- from project.paramsin as data, dict.param as dict
- where dict.entry = &entry and data.paramno = dict.paramno
- order by 5
- ;
-
- %mend readdict;
-
- Note that when I use the MPRINT = ON option that the above SQL code is mprinted
- followed by the error message. The only way out is to kill the job.
-
- I'm using V6.07 for HP300.
-
- Bob Snyder, Texas Instruments, Sherman, TX
-