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

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!paladin.american.edu!auvm!LOBBY.TI.COM!RSNYDER
  3. X-Mailer: ELM [version 2.2 PL16]
  4. Message-ID: <9207231710.AA00799@ti.com>
  5. Newsgroups: bit.listserv.sas-l
  6. Date:         Thu, 23 Jul 1992 12:10:15 CDT
  7. Reply-To:     "R. Snyder" <rsnyder@LOBBY.TI.COM>
  8. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  9. From:         "R. Snyder" <rsnyder@LOBBY.TI.COM>
  10. Subject:      V6.07, HP300 Macro Problem
  11. Comments: To: sas-l@uga.cc.uga.edu
  12. Lines: 239
  13.  
  14. Hello everyone!
  15.  
  16. I have a situation (it woild be a problem if I couldn't get around it) that
  17. has me completely stumped. Maybe some of you Macro Language gurus can give
  18. me a clue.
  19.  
  20. The situation:
  21.  
  22. The following works fine.
  23.  
  24.  
  25. /*---------------------------- PAVEWAY FIS ------------------------------*/
  26. /*                                                                       */
  27. /* MODULE: tstdata.sas                                                   */
  28. /*                                                                       */
  29. /* AUTHOR: Bob Snyder                                                    */
  30. /*                                                                       */
  31. /* LANGUAGE: SAS / SAS Macro language                                    */
  32. /*                                                                       */
  33. /* ABSTRACT: This module stores AT test data to the local database. It   */
  34. /* also triggers SPC analysis of the data.                               */
  35. /*                                                                       */
  36. /*-----------------------------------------------------------------------*/
  37.  
  38. %macro tstdata;
  39.  
  40.   /* Macro Variable Declarations */
  41.  
  42.   %local dupfile;
  43.  
  44.   /* Check archive.event for a duplicate filename. */
  45.   %checkdup( event );
  46.  
  47.   %if &dupfile eq 0 %then
  48.     %do;
  49.  
  50.       /* Indicate that data storage has begun. */
  51.       %display DataIn.storing noinput;
  52.  
  53.       /* Get the next event number from archive.events. */
  54.       %getevent;
  55.  
  56.       /* Update the event number in the working data set. */
  57.       %upevent;
  58.  
  59.       /* Retrieve the dictionary entry for the test software. */
  60.       %getentry;
  61.  
  62.       /* Create a view that joins the data to the dictionary. */
  63.       %readdict;                        /* Create work.params */
  64.  
  65.       /* Perform data input tasks common to all test sets. */
  66.  
  67.       proc append out=archive.event   new=work.newevnt;
  68.       proc append out=archive.test    new=project.testsin;
  69.       proc append out=archive.param   new=work.params;
  70.  
  71.       /* Do the required data input tasks for the particular test set. */
  72.  
  73.       %if %upcase( &testset ) eq &tsname1 %then
  74.         %do;
  75.           proc append out=archive.ofpdata new=project.ofpin;
  76.           run;
  77.         %end;
  78.       %else %if %upcase( &testset ) eq &tsname2 %then
  79.         %do;
  80.           proc append out=archive.ofpdata new=project.ofpin;
  81.           run;
  82.         %end;
  83.       %else
  84.         %do;
  85.           run;
  86.         %end;
  87.  
  88.       /* Archive the test data to the server. */
  89. /*    %archtst; */
  90.  
  91.     %end;
  92.   %else
  93.     %do;
  94.       %display DataIn.duplicat;
  95.       %whenerr;
  96.     %end;
  97.  
  98. %mend tstdata;
  99.  
  100. ============================================================================
  101.  
  102. The following blows up.
  103.  
  104.  
  105. /*---------------------------- PAVEWAY FIS ------------------------------*/
  106. /*                                                                       */
  107. /* MODULE: tstdata.sas                                                   */
  108. /*                                                                       */
  109. /* AUTHOR: Bob Snyder                                                    */
  110. /*                                                                       */
  111. /* LANGUAGE: SAS / SAS Macro language                                    */
  112. /*                                                                       */
  113. /* ABSTRACT: This module stores AT test data to the local database. It   */
  114. /* also triggers SPC analysis of the data.                               */
  115. /*                                                                       */
  116. /*-----------------------------------------------------------------------*/
  117.  
  118. %macro tstdata;
  119.  
  120.   /* Macro Variable Declarations */
  121.  
  122.   %local dupfile;
  123.  
  124.   /* Check archive.event for a duplicate filename. */
  125.   %checkdup( event );
  126.  
  127.   %if &dupfile eq 0 %then
  128.     %do;
  129.  
  130.       /* Indicate that data storage has begun. */
  131.       %display DataIn.storing noinput;
  132.  
  133.       /* Get the next event number from archive.events. */
  134.       %getevent;
  135.  
  136.       /* Update the event number in the working data set. */
  137.       %upevent;
  138.  
  139.       /* Retrieve the dictionary entry for the test software. */
  140.       %getentry;
  141.  
  142.       /* Create a view that joins the data to the dictionary. */
  143.       %readdict;                        /* Create work.params */
  144.  
  145.       %makesets( archive );
  146.  
  147.       /* Archive the test data to the server. */
  148. /*    %archtst; */
  149.  
  150.     %end;
  151.   %else
  152.     %do;
  153.       %display DataIn.duplicat;
  154.       %whenerr;
  155.     %end;
  156.  
  157. %mend tstdata;
  158.  
  159. ------------------------------------------------------------------------------
  160.  
  161.  
  162. %macro makesets( target );
  163. %put ******************************** tolocal;
  164.   /* Retrieve the dictionary entry for the test software. */
  165.   %getentry;
  166.  
  167.   /* Create a view that joins the data to the dictionary. */
  168.   %readdict;                        /* Create work.params */
  169.  
  170.   /* Perform data input tasks common to all test sets. */
  171.  
  172.   proc append out=&target..event   new=work.newevnt;
  173.   proc append out=&target..test    new=project.testsin;
  174.   proc append out=&target..param   new=work.params;
  175.  
  176.   /* Do the required data input tasks for the particular test set. */
  177.  
  178.   %if %upcase( &testset ) eq &tsname1 %then
  179.     %do;
  180.       proc append out=&target..ofpdata new=project.ofpin;
  181.       run;
  182.     %end;
  183.   %else %if %upcase( &testset ) eq &tsname2 %then
  184.     %do;
  185.       proc append out=&target..ofpdata new=project.ofpin;
  186.       run;
  187.     %end;
  188.   %else
  189.     %do;
  190.       run;
  191.     %end;
  192.  
  193. mend makesets;
  194.  
  195. ===========================================================================
  196.  
  197. During the execution of the macro readdict the following error message is
  198. written to the SAS log over and over again forever:
  199.  
  200. ERROR: Invalid %DISPLAY option .
  201.  
  202. The macro readdict is included for reference.
  203.  
  204.  
  205. /*---------------------------- PAVEWAY FIS ------------------------------*/
  206. /*                                                                       */
  207. /* MODULE: readdict.sas                                                  */
  208. /*                                                                       */
  209. /* AUTHOR: Bob Snyder                                                    */
  210. /*                                                                       */
  211. /* LANGUAGE: SAS / SAS Macro language                                    */
  212. /*                                                                       */
  213. /* ABSTRACT: This module joins the dictionary to the test data to supply */
  214. /* information not supplied by the test set. While this is a             */
  215. /* de-normalization it will make the data easier to read and query.      */
  216. /*                                                                       */
  217. /*-----------------------------------------------------------------------*/
  218.  
  219. %macro readdict;
  220.  
  221.   proc sql;
  222.  
  223.     create view work.params as
  224.  
  225.     select data.eventno, data.filename, dict.testno, dict.subtest,
  226.            data.paramno, dict.xrefno, data.measid, data.val,
  227.            case data.nom
  228.              when . then dict.nom
  229.              else        data.nom
  230.            end as nom,
  231.            case data.ll
  232.              when . then dict.lsl
  233.              else        data.ll
  234.            end as ll,
  235.            case data.ul
  236.              when . then dict.usl
  237.              else        data.ul
  238.            end as ul,
  239.            data.p_f
  240.       from project.paramsin as data, dict.param as dict
  241.         where dict.entry = &entry and data.paramno = dict.paramno
  242.     order by 5
  243.     ;
  244.  
  245. %mend readdict;
  246.  
  247. Note that when I use the MPRINT = ON option that the above SQL code is mprinted
  248. followed by the error message. The only way out is to kill the job.
  249.  
  250. I'm using V6.07 for HP300.
  251.  
  252. Bob Snyder, Texas Instruments, Sherman, TX
  253.