SAS Tutorial: Coding PUTs Without Coding PUTs

Listing 2: The SAS Job Run Output

Note that Listing 2 is composed of two parts:

This is in keeping with the original format as required for publication in the WISAS proceedings.

LISTING 2a: Part 1 of the Generated SAS Code

001 NOTE: SAS system options specified are:
002        DQUOTE,MACRO,SYMBOLGEN,MACROGEN
003 
004  1          OPTIONS SOURCE SOURCE2 MPRINT LS=149;
005  2          **********************************************************************;
006  3          * PROGRAM NAME: JPLAXCO.P.SAS(WS9605)                                *
007  4          * AUTHORS NAME: JIM PLAXCO                                           *
008  5          * DESCRIPTION : TEST PROGRAM TO ILLUSTRATE USE OF THE MACROS         *
009  6          *                                                                    *
010  7          *               FOR WISAS                                            *
011  8          **********************************************************************;
012  9
013  10         **********************************************************************;
014  11         *  STEP01 - BUILD DATA FILE (METE                                    *
015  12         **********************************************************************;
016  13         DATA DATA1 (KEEP=KDIAM DIAM RADIUS VOLUME MASS MTMASS ENRGY YIELD
017  14                          DAMAGE DAMRD ABOMB);
018  15
019 *** LINES 16 - 59 OMITTED
020  60         CALL SYMPUT('TOTOBS',NDX);
021  61         CALL SYMPUT('PHEAD1','EVALUATION OF BOLIDE IMPACT ENERGIES ASSUMING:');
022  62         CALL SYMPUT('PHEAD2','   - VELOCITY OF 20 KILOMETERS/SECOND');
023  63         CALL SYMPUT('PHEAD3','   - DENSITY OF 3 GRAMS PER CUBIC CM');
024  64         RUN;
025 
026  NOTE: The data set WORK.DATA1 has 100 observations and 11 variables.
027 
028  65
029  66         %HDRIN(JPLAXCO.P.HDRS(WS9605),HDR,49)
030  MPRINT(HDRIN):   DATA HDR (DROP=LINES);
031  MPRINT(HDRIN):   INFILE "JPLAXCO.P.HDRS(WS9605)" LENGTH=RECLEN MISSOVER END=EOFFLAG;
032  MPRINT(HDRIN):   RETAIN LINES 0;
033  MPRINT(HDRIN):   INPUT @1 HDRDATA $VARYING49. RECLEN;
034  MPRINT(HDRIN):   LINES+1;
035  MPRINT(HDRIN):   IF EOFFLAG THEN CALL SYMPUT('HDRIN_N',LINES);
036  67         RUN;
037 
038  NOTE: Numeric values have been converted to character values at 
           the places given by:(Line):(Column).
039        66:11
040  NOTE: The infile "JPLAXCO.P.HDRS(WS9605)" is:
041        Dsname=JPLAXCO.P.HDRS(WS9605),
042        Unit=9345,Volume=S5Q014,Disp=SHR,Blksize=23250,
043        Lrecl=250,Recfm=VB
044 
045  NOTE: 5 records were read from the infile "JPLAXCO.P.HDRS(WS9605)".
046        The minimum record length was 85.
047        The maximum record length was 92.

LISTING 2b: Part 2 of the Generated SAS Code

001  68
002  69         %MULTIC(DATA1,RPTOUT,3,150,52,KDIAM,8,5,2,5.2,
003  70                DAMRD,8,7,4,6.1,YIELD,8,8,2,E8.,ABOMB,8,11,0,COMMA11.0)
004  MPRINT(MULTIC):   DATA _NULL_;
005  MPRINT(MULTIC):   FILE RPTOUT NOPRINT NOTITLES;
006  MPRINT(MULTIC):   RETAIN NDX NOMORE 0;
007  MPRINT(MULTIC):   RETAIN EVAR 0;
008  MPRINT(MULTIC):   RETAIN PB 0CX;
009  MPRINT(MULTIC):   RETAIN IC1 0 ;
010  MPRINT(MULTIC):   RETAIN IC2 0 ;
011  MPRINT(MULTIC):   RETAIN IC3 0 ;
012  MPRINT(MULTIC):   RETAIN EPP 0 ;
013  MPRINT(MULTIC):   RETAIN EPC 0 ;
014  MPRINT(MULTIC):   RETAIN ENDC1 1 ;
015  MPRINT(MULTIC):   RETAIN PNDX 0 ;
016  MPRINT(MULTIC):   ARRAY AKDIAM{100} 8 KDIAM1-KDIAM100 ;
017  MPRINT(MULTIC):   RETAIN KDIAM1-KDIAM100 ;
018  MPRINT(MULTIC):   ARRAY ADAMRD{100} 8 DAMRD1-DAMRD100 ;
019  MPRINT(MULTIC):   RETAIN DAMRD1-DAMRD100 ;
020  MPRINT(MULTIC):   ARRAY AYIELD{100} 8 YIELD1-YIELD100 ;
021  MPRINT(MULTIC):   RETAIN YIELD1-YIELD100 ;
022  MPRINT(MULTIC):   ARRAY AABOMB{100} 8 ABOMB1-ABOMB100 ;
023  MPRINT(MULTIC):   RETAIN ABOMB1-ABOMB100 ;
024  MPRINT(MULTIC):   DO UNTIL (NOMORE=1);
025  MPRINT(MULTIC):   SET DATA1 END=NOMORE;
026  MPRINT(MULTIC):   NDX + 1;
027  MPRINT(MULTIC):   AKDIAM{NDX} = KDIAM;
028  MPRINT(MULTIC):   ADAMRD{NDX} = DAMRD;
029  MPRINT(MULTIC):   AYIELD{NDX} = YIELD;
030  MPRINT(MULTIC):   AABOMB{NDX} = ABOMB;
031  MPRINT(MULTIC):   END;
032  MPRINT(MULTIC):   EPP = INT(3* 43);
033  MPRINT(MULTIC):   EPC = INT(EPP/3);
034  MPRINT(MULTIC):   DO UNTIL(IC3 > 100);
035  MPRINT(MULTIC):   LINK HDR;
036  MPRINT(MULTIC):   IC1 = INT(1+(PNDX*EPP));
037  MPRINT(MULTIC):   PNDX+1;
038  MPRINT(MULTIC):   ENDC = IC1 + EPC;
039  MPRINT(MULTIC):   IC2 = ENDC;
040  MPRINT(MULTIC):   IC3 = EPC + IC2 ;
041  MPRINT(MULTIC):   DO UNTIL( IC1 = ENDC );
042  MPRINT(MULTIC):   IF IC1<=100 THEN PUT @3+0 AKDIAM{IC1} 5.2  
                                               @14+0 ADAMRD{IC1} 6.1
                                               @27+0 AYIELD{IC1} E8. 
                                               @37+0 AABOMB{IC1} COMMA11.0 @ ;
043  MPRINT(MULTIC):   PUT @50 '|' @ ;
044  MPRINT(MULTIC):   IF IC2 <= 100 THEN PUT @3+50 AKDIAM{IC2} 5.2  
                                                 @14+50 ADAMRD{IC2} 6.1
                                                 @27+50 AYIELD{IC2} E8. 
                                                 @37+50 AABOMB{IC2} COMMA11.0 @ ;
045  MPRINT(MULTIC):   PUT @100 '|' @ ;
046  MPRINT(MULTIC):   IF IC3 <= 100 THEN PUT @3+100 AKDIAM{IC3} 5.2  
                                                 @14+100 ADAMRD{IC3} 6.1
                                                 @27+100 AYIELD{IC3} E8. 
                                                 @37+100 AABOMB{IC3} COMMA11.0 ;
047  MPRINT(MULTIC):   ELSE PUT;
048  MPRINT(MULTIC):   IC1 + 1;
049  MPRINT(MULTIC):   IC2 + 1;
050  MPRINT(MULTIC):   IC3 + 1;
051  MPRINT(MULTIC):   END;
052  MPRINT(MULTIC):   END;
053  MPRINT(MULTIC):   RETURN;
054  MPRINT(MULTIC):   **********************************************************************;
055  MPRINT(MULTIC):   HDR: PUT @01 PB IB1. @ ;
056  MPRINT(MULTIC):   PUT @53 "EVALUATION OF BOLIDE IMPACT ENERGIES ASSUMING:";
057  MPRINT(MULTIC):   PUT @59 "   - VELOCITY OF 20 KILOMETERS/SECOND";
058  MPRINT(MULTIC):   PUT @59 "   - DENSITY OF 3 GRAMS PER CUBIC CM";
059  MPRINT(MULTIC):   PUT ' ';
060  MPRINT(MULTIC):   DO HDR_LINE=1 TO LASTLINE BY 1;
061  MPRINT(MULTIC):   SET HDR POINT=HDR_LINE NOBS=LASTLINE;
062  MPRINT(MULTIC):   PUT @1+0 HDRDATA $CHAR50. @1+50 HDRDATA $CHAR50. 
                           @1+100 HDRDATA $CHAR50. ;
063  MPRINT(MULTIC):   END;
064  MPRINT(MULTIC):   RETURN;
065  71         RUN;
066 
067  NOTE: The file RPTOUT is:
068        Dsname=JPLAXCO.PRINT,
069        Unit=3390,Volume=ST1236,Disp=OLD,Blksize=6144,
070        Lrecl=154,Recfm=VBA

Return to the SAS Tutorial: Coding PUTs Without Coding PUTs tutorial.