         SYSTEM   SIG7
         SYSTEM   BPM
         TITLE    'STATS B00 - PERFORMANCE MONITOR'
CONTROLP CSECT    1
F        EQU      X'10000'          BUFFERED MONITOR DATA
G        EQU      X'14000'
CTIME    EQU      F                 DATE/TIME OVERWRITE FOR FILE
BSIZE    EQU      24*512            MAXIMUM BUFFER LENGTH
*        ABSOLUTE REF'S
         REF      ENDPMPRC
         REF      SCU
         REF      BGNPMPRC
         REF      STOB
         REF      STI
         REF      SW
         REF      SIOW
         REF      STOBO
         REF      STIO
         REF      PPROCS
         REF      SMUIS
         REF      S:CUIS
         REF      S:BUIS            BATCH USERS IN SYSTEM
         REF      S:OUIS
         REF      S:GUIS            GHOST JOBS IN SYSTEM
         SREF     LNOL
         PAGE
*        REF'S IN PMDAT MODULE
         REF      C:RT90
         REF      C:SC
         REF      C:TIC
         REF      C:TINC
         REF      C:ETM
         REF      C:CIT
         REF      C:CITI
         REF      C:CAL
         REF      C:CTW
         REF      C:CI
         REF      C:CO
         REF      C:RTRW
         REF      C:CSC
         REF      C:COS
         REF      C:SCO
         REF      C:MSO
         REF      C:SCB
         REF      C:MSB
         REF      C:IDLE
         REF      C:IDLES
         REF      C:IDLEW
         REF      C:IDLESW
         REF      C:SIT
         REF      C:SRT
         REF      C:STT
         REF      C:ST
         REF      C:SCI
*        REF'S FOR HALFWORD DISTRIBUTIONS
         REF      CH:DI1
         REF      CH:DI2
         REF      CH:DI3
         REF      CH:DOT
         REF      CH:DOS
         REF      CH:DRT
         REF      CH:DIT
         REF      CH:DTT
         REF      CH:DT
         REF      CH:DC
         REF      CH:DLI
         REF      CH:DLO
         REF      C:LAST
*        OTHER MONITOR REF'S
         SREF     LB:UN
         SREF     EOMTIME
         REF      P:NAME
         REF      PBT:LOCK
         REF      S:BUAIS
         REF      SL:TB
         REF      SL:UB
         REF      SL:QUAN
         REF      SL:QMIN
         REF      SL:SQUAN
         REF      SL:BB
         REF      S:OUAIS
*        USER STATE TABLE REF'S
         REF      UH:FLG
         REF      UB:FL
         REF      SB:HQ
         REF      UB:ACP
         REF      UB:PCT
         REF      UB:US
         REF      UB:APR
         REF      UB:ASP
         REF      UB:DB
         REF      J:JIT
         REF      J:OVHTIM
         REF      J:DELTAT
*        JIT BYTE REF
         REF,1    JB:PRIV
         REF      M:DO
         REF      M:LO
         REF      M:SI
         REF      PLH:SID
         REF      PLH:QN
         DEF      F
         DEF      G
         DEF      CONTROLP
         DEF      CONTROLD
         DEF      LSTAR
         DEF      INIT
         DEF      PATCH
         PAGE
SON      EQU      2
SOFF     EQU      28
SEC      EQU      3
SBK      EQU      4
STOC     EQU      6
SC       EQU      7
SIOIP    EQU      17
SIOC     EQU      18
SIOIP2   EQU      19
SIOC2    EQU      20
SQA      EQU      22
SIR      EQU      5
SCOM     EQU      8
SBAT     EQU      9
*
D30      EQU      14                # OF PARAM ITEMS
D31      EQU      14                DEPTH OF GROUP 31, B 4 , SUMMARY
D32      EQU      10                DEPTH OF GROUP 32, CPU
D33      EQU      12                BATCH
D34      EQU      12                ONLINE
D35      EQU      12                USERS
D36      EQU      9                 I/O
D37      EQU      6                 TASK
D38      EQU      10                QUEUE
DT       EQU      D31+D32+D33+D34+D35+D36+D37+D38
         PAGE
*EQUS FOR REGISTERS, ETC.
R        EQU      0
RI1      EQU      1
RI2      EQU      2
RI       EQU      3
RII      EQU      4
RIII     EQU      5
RI6      EQU      6
ERETURN  EQU      6                 ALTERNATE,ERROR LINK
RETURN   EQU      7
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
R8       EQU      8
R9       EQU      9
R10      EQU      10
R11      EQU      11
R12      EQU      12
R13      EQU      13
R14      EQU      14
R15      EQU      15
         PAGE                        PROC DEFINITIONS
TYPE     CNAME
         PROC
         DISP      %
         LIST     0
         USECT    CONTROLD
TEXTADD  SET      %
LF(2)    TEXTC    ' ',AF(1)
         USECT    CONTROLP
LF(1)    LI,R2    TEXTADD
         LB,R1    *R2
         CAL1,1   DO
         LIST     1
         PEND
         PAGE                        TRANSFER BYTE STRING
BYTRAN   CNAME
         PROC
*        BYTRAN   COUNT,SOURCE,DESTINATION
*                 MOVE BYTE STRING     SOURCE-->DESTINATION
         DISP     %
         LIST     0
LF(1)    LW,R9    =AF(3)            AF(3) MUST BE BYTE ADDRESS
         LI,R8    AF(1)             AF(1) MUST BE BYTE COUNT
         STB,R8   R9
         LW,R8    =AF(2)            AF(2) MUST BE BYTE ADDRESS
         MBS,R8   0                 MOVE BYTE STRING
         LIST     1
         PEND
         PAGE
BYTRAD   CNAME                      ADD BYTE STRING TO BYTRAN
         PROC
* AF(1)           NUMBER OF BYTES TO BE TRANSFERRED.
* AF(2)           BA(NEW SOURCE BUFFER)
*                 BA(DESTINATION) ASSUMED TO LEFT IN R3 FROM BYTRAN
         DISP     %
         LIST     0
LF(1)    LI,R8    AF(1)             AF(1) MUST BE BYTE COUNT
         STB,R8   R9
         LW,R8    =AF(2)            AF(2) MUST BE BYTE ADDRESS
         MBS,R8   0                 MOVE BYTE STRING
         LIST     1
         PEND
         PAGE                        TYPE TEXT IN BUFFER VIA M:DO
ATYPE    CNAME
         PROC
         DISP     %
         LIST     0
LF(1)    LI,R2    BUFFER
         LW,R1    VBUFCNT
         CAL1,1   ADO
         LI,R     1
         STW,R    VBUFCNT
         LIST     1
         PEND
         PAGE
FLDMOV   CNAME
         PROC
*        FLDMOV   RCOUNT,SOURCE,SPOINT,DESTINATION,DPOINT
* AF(1)  RCOUNT   REG(BYTE COUNT)
* AF(2)  SOURCE   BA(SOURCE BUFFER)
* AF(3)  SPOINT   WA(BYTE POINTER FOR SOURCE)
* AF(4)  DESTIN   BA(DESTINATION BUFFER)
* AF(5)  DPOINT   WA(BYTE POINTER FOR DESTINATION)
         DISP     %
         LIST     0
LF(1)    LI,R9    AF(4)             BA(DESTINATION)
         AW,R9    AF(5)             ADD DISPLACEMENT
         LW,R8    AF(1)
         STB,R8   R9                STORE COUNT IN LEFT BYTE
         LI,R8    AF(2)
         AW,R8    AF(3)             ADD DISPLACEMENT
         MBS,R8   0                 MOVE BYTE STRING
         LIST     1
         PEND
         PAGE                        DATA PROCS
RESERVE  CNAME
         PROC
         DISP     %
         LIST     0                 DO NOT PRINT
LF(1)    DO1      AF(1)             SET DATA BLOCK = 0
         DATA     0
         LIST     1
         PEND
*
STRING   CNAME                       TEXT STRING WITHOUT LISTING
         PROC
         DISP     %
         LIST     0
LF(1)    TEXT     AF
         LIST     1
         PEND
*
STRINGC  CNAME                       TEXTC STRING WITHOUT LISTING
         PROC
         DISP     %
         LIST     0
LF(1)    TEXTC    AF
         LIST     1
         PEND
*
DATUM    CNAME
         PROC
         DISP     %
         LIST     0
LF(1)    EQU      %
I        DO       NUM(AF)
         DATA     AF(I)
         FIN
         LIST     1
         PEND
*
         PAGE
CPUSUM   CNAME
         PROC
         DISP     %
         LIST     0
LF(1)    GEN,8,24  IDISP,AF(2)
         GEN,8,24  PLUS,AF(1)+F
         GEN,8,24  ADDTO,TOTAL
         GEN,8,24  NEXT,0
         LIST     1
         PEND
INTER    CNAME
         PROC
         DISP     %
         LIST     0
LF(1)    GEN,8,24  IDISP,AF(1)
         GEN,8,24  SUM,CH:DT+F
         GEN,8,24  ADDTO,TOTAL
         GEN,8,24  NEXT,0
         LIST     1
         PEND
STABLE   CNAME                      SUM USERS BY PROCESSOR
         PROC
         DISP     %
         LIST     0
LF(1)    GEN,8,24  TABLE,UB:APR+F   ASSOCIATED PROCESSOR
         GEN,8,24  SUMDISP,AF(1)
         GEN,8,24  TABLE,UB:ASP+F   ASSOCIATED SPECIAL PROCESSOR
         GEN,8,24  SUMDISP,AF(1)
         GEN,8,24  TABLE,UB:DB+F    DEBUG PROCESSOR
         GEN,8,24  SUMDISP,AF(1)
         GEN,8,24  NEXT,0
         LIST     1
         PEND
         PAGE
SNAPHIS  CNAME                      COMPUTE, STORE SNAPSHOT DISTRIB
*                                   SAVE NEW VALUES
         PROC
* AF(1)  NEW      WA(NEW DISTRIBUTION) IN MONITOR BUFFER AREA
* AF(2)  OLD      WA(OLD DISTRIBUTION)
* AF(3)  DIF      WA(SNAPSHOT DISTRIBUTION)
* AF(4)  N        NUMBER OF DISTRIBUTIONS IN GROUP
* AF(5)           WA(SNAPSHOT DISTRIBUTION TOTALS)
         DISP     %
         LIST     0
         LOCAL    L1,L2
LF(1)    LI,R1    AF(4)
         LI,R4    0
         LI,R5    0
         LI,R6    0
         LI,R2    2
L1       LH,R8    AF(1)+F,R5
         STH,R8   AF(3),R5          SAVE SCALE
         AI,R5    1
         BDR,R2   L1
         LI,R2    14                14 HALFWORDS/DISTRIBUTION
L2       LH,R8    AF(1)+F,R5
         AND,R8   =X'0000FFFF'      HALFWORD UNSIGNED POS VALUE
         LH,R9    AF(2),R5
         AND,R9   =X'0000FFFF'
         STH,R8   AF(2),R5          STORE NEW OVER OLD
*        IF NEW LESS THAN OLD ASSUME HALFWORD OVERFLOW
         CW,R8    R9
         BGE      %+2
         AW,R8    =X'00010000'
         SW,R8    R9
         AW,R4    R8
         STH,R8   AF(3),R5          STORE DIFFERENCE
         AI,R5    1
         BDR,R2   L2
         STW,R4   AF(5),R6
         AI,R6    1
         LI,R4    0
         BDR,R1   %-18
         LIST     1
         PEND
         PAGE
TSUM     CNAME
         PROC
         DISP     %
         LIST     0
* AF(1)           WA(NEW SUMS) IN MONITOR BUFFER
* AF(2)           WA(OLD SUMS)
* AF(3)           WA(SNAPSHOT SUMS)
* AF(4)           NUMBER OF ENTRIES IN TABLE
LF(1)    LI,R1    AF(4)
         LW,R8    AF(1)+F-1,R1      LOAD NEW
         LW,R9    AF(2)-1,R1        LOAD OLD
         STW,R8   AF(2)-1,R1        UPDATE OLD SUM
         SW,R8    R9                NEW-OLD
         STW,R8   AF(3)-1,R1        STORE SNAPSHOT SUM
         BDR,R1   %-5
         LIST     1
         PEND
         PAGE
PERCENT  CNAME
         PROC
*        PERCENT  HIST,TOT,N
* AF(1)           WA(HALFWORD HISTOGRAM)
* AF(2)           WA(HISTOGRAM TOTALS)
* AF(3)           VALUE OF # OF COLUMNS
         DISP     %
         LIST     0
         LOCAL    L1,L2
LF       LI,RI    AF(3)             # OF COLUMNS
L1       LW,R1    AF(1),RII
         LH,R9    *R1,RIII
         LW,R10   AF(2),RII
         LW,R10   *R10
         LI,R8    0
         MW,R8    =1000
         MTW,0    R10
         BEZ      L2
         DW,R8    R10
         AW,R8    R8
         BEZ      L2
         CW,R8    R10
         BL       L2
         AI,R9    1
L2       LI,R1    4                 # OF DIGITS
         LW,R2    R9
         BAL,RETURN  SBINOUT
         BAL,RETURN  SPD
         AI,RII   -1                DECREMENT COLUMN INDEX
         BDR,RI   L1                LOOP THROUGH GROUP
         LIST     1
         PEND
         PAGE
CLOSAVE  CNAME                      CLOSE OPEN DCBS WITH SAVE
         PROC
         DISP     %
         LIST     0
LF(1)    LH,R     AF(1)             ARGUMENT MUST BE DCB NAME
         CI,R     X'20'
         BAZ      %+2
         M:CLOSE  AF(1),(SAVE)
         LIST     1
         PEND
*        MERGE TEXTC STRINGS AND PRINT ONE LINE
PRINT    CNAME
         PROC
         DISP     %
         LIST     0
LF(1)    EQU      %
I        DO       NUM(AF)
         LI,R1    AF(I)
         BAL,RETURN  SOUTA
         FIN
         BAL,RETURN  SEND
         LIST     1
         PEND
         PAGE                        NAMES FOR PROCESSOR SEARCH
PROCS    EQU      %-2
         STRINGC  'BASIC'
         STRINGC  'DELTA'
         STRINGC  'EDIT'
         STRINGC  ':P00'            FDP, FORTRAN DEBUG PACKAGE
         STRINGC  'FORT'
         STRINGC  ':P11'            FORTRAN LIBRARY NAME
         STRINGC  'LINK'
         STRINGC  'LOADER'
         STRINGC  'LOGON'
         STRINGC  'METASYM'
         STRINGC  'PCL'
         STRING   '    '
         STRINGC  'TEXT'
#PROCS   EQU      DA(%)-DA(PROCS)-1
         PAGE
HTEN     DATA,2   10,0              HALFWORD CONSTANT
HTTHO    DATA,2   2000,0
         BOUND    8
BLANK    STRING   '        '
*
DO       GEN,8,24  X'11',M:DO           FPT FOR TERMINAL OUTPUT
         DATUM    X'34000000'
         PZE      *R2               BUFFER ADDRESS
         PZE      *R1               BUFFER SIZE
         DATUM    1
*
ADO      GEN,8,24  X'11',M:DO        FPT FOR TERMINAL OUTPUT
         DATUM    X'34000000'
         PZE      *R2               BUFFER ADDRESS
         PZE      *R1               BUFFER SIZE
         DATUM    0                 ZERO BYTE DISPLACEMENT
*
PAGE     GEN,8,7,17 4,0,M:LO
         PAGE
AVAL1    EQU      %-1               POINTERS TO CONTROL PARAM
         DATUM    VHRMN,VMIN
         DATUM    S:BUAIS+F,S:OUAIS+F
         DATUM    AVBATP,AVONLP
         DATUM    SL:TB+F,SL:UB+F
         DATUM    SL:QMIN+F,SL:SQUAN+F
         DATUM    ABQUAN,SL:QUAN+F
         DATUM    SL:BB+F,TOTVIR
AVAL2    EQU      %-1
         DATUM    C:CIT+F,C:TIC+F,S:CUIS+F
AGET3    EQU      %-1               POINTERS TO POP TABLES
         DATUM    GROUP31,GROUP32,GROUP33,GROUP34
         DATUM    GROUP35,GROUP36,GROUP37,GROUP38
*SCALING FACTORS
ASCAL1   EQU      %-1
         DATUM    1,1               0=*2,A=YES/NO,OTHER DIVIDE
         DATUM    1,1
         DATUM    2,2               CONVERT PAGES TO K
         DATUM    1,1
         DATUM    0,0
         DATUM    0,0
         DATUM    C'A',0
ASCAL2   EQU      %-1
         DATUM    1
         DATUM    500*60
         DATUM    1
ADIV3    EQU      %-1               DIVISION FLAGS
         DATUM    1,1,1,1,0,1,1,0
ASAM3    EQU      %-1               TWO COLUMNS
         DATUM    1,1,1,1,0,1,1,0,
ADEC3    EQU      %-1               DECIMAL POINT FLAGS
         DATUM    1,1,1,1,0,0,0,0
ALENG3   EQU      %-1               DIGITS PER NUMBER
         DATUM    7,5,5,5,3,6,7,3
ADEPTH3  EQU      %-1               DEPTH OF GROUPS
         DATUM    D31,D32,D33,D34,D35,D36,D37,D38
ASCAL3   EQU      %-1               GROUP 31-38 SCALE FACTORS
         DATUM    10,1000,1000,1000,1,30000,1,1
         PAGE
*EQUS FOR ACTION NAMES IN GET TABLES
PLUS     EQU      1     X=X+OP(DISP)
PLUSBYT  EQU      2     X=X+BYTE OP(DISP)
MINUS    EQU      3     X=X-OP(DISP)
TIMES    EQU      4     X=X*OP
DIVIDE   EQU      5     X=X/OP ROUNDED
SUM      EQU      6     X=SUM OF 14 1/2 WORDS AT OP+2
DISP     EQU      7     DISP=OP
ADDTO    EQU      8     OP=OP+X
SAVESUM  EQU      9     SUM(RI)=X
NEXT     EQU      10                ANEW3(RIII)=X;RIII=RIII+1,DISP=0
DONE     EQU      11    RETURN.
IDISP    EQU      12    DISP=OP IMMEDIATE
SAVEZERO EQU      13          OP=X;X=0
FLAG     EQU      14                X=#USERS WITH BIT(S)OP
DISP0    EQU      15                DISP=OP+BGNPMPRC-1
SUMQUEUE EQU      16
SIZE     EQU      17
SUMBTBL  EQU      18
TABLE    EQU      19
SUMDISP  EQU      20
LLOGMIN  EQU      21                ADD LOGGED MIN NOT IN C:SIT
STATQ    EQU      22
*
*GET TABLES FOR SUMMARY
GROUP31  EQU      %
**
         GEN,8,24  PLUS,C:SIT+F     SUM OF INTERACTION TIMES
         GEN,8,24  LLOGMIN,0        ACCUMULATE OTHER INTERACTION TIME
         GEN,8,24  DIVIDE,=500      IN SECONDS
         GEN,8,24  SAVEZERO,VOSIT   SAVE FOR A DIVISOR
**
         GEN,8,24  PLUS,C:ST+F      THINK - TYPE TIME
         GEN,8,24  DIVIDE,=500      CONVERT TO SECONDS
         GEN,8,24  SAVEZERO,VTYP   SAVE FOR A DIVISOR
**
         GEN,8,24  PLUS,C:CIT+F     # INTERACTIONS
         GEN,8,24  SAVEZERO,VCIT    SAVE FOR DIVISOR
**
         GEN,8,24  PLUS,C:CITI+F    # INTERACTIVE INTERACTIONS
         GEN,8,24  SAVEZERO,VCITI   SAVE FOR DIVISOR
**
         GEN,8,24  PLUS,C:SCI+F     SUM INTERACTIVE COMPUTING
         GEN,8,24  SAVEZERO,VSCI
**
         GEN,8,24  PLUS,S:BUIS+F
         GEN,8,24  SAVEZERO,BATCH   SAVE #OF BATCH USERS
**
         GEN,8,24  PLUS,S:GUIS+F
         GEN,8,24  SAVEZERO,GHOSTS  SAVE # GHOSTS
**
         GEN,8,24  TABLE,UB:ACP+F   ASSOCIATED CONTROL PROCESSORS
         GEN,8,24  SUMDISP,DLOGON
         GEN,8,24  SAVEZERO,LOGON   SAVE # IN LOGON OR LOGOFF
**
         GEN,8,24  STATQ,SOFF
         GEN,8,24  SAVEZERO,LOGOFF
**
         GEN,8,24  IDISP,0
         GEN,8,24  PLUS,S:CUIS+F    GET TOTAL #
         GEN,8,24  MINUS,S:BUIS+F   MINUS BATCH USERS
         GEN,8,24  MINUS,GHOSTS     MINUS GHOSTS
         GEN,8,24  MINUS,LOGON      MINUS USERS IN LOGON PROCESSOR
         GEN,8,24  SAVEZERO,VLUS
**
         GEN,8,24  PLUS,VLUS        STROBE AT END OF SAMPLE
         GEN,8,24  PLUS,VOLUS       STROBE AT BEGIN OF SAMPLE
         GEN,8,24  TIMES,=5         *10/2 SCALED AND AVERAGED
         GEN,8,24  SAVEZERO,VUAVE   AVERAGE # OF LOGGED USERS
**
         GEN,8,24  PLUS,C:SCB+F
         GEN,8,24  SAVEZERO,VBCPU
**
         GEN,8,24  PLUS,C:SCO+F
         GEN,8,24  SAVEZERO,VCPU
**
         GEN,8,24  PLUS,VTIC
         GEN,8,24  MINUS,VOTIC
         GEN,8,24  SAVEZERO,DTIC
**
         GEN,8,24  PLUS,VBCPU
         GEN,8,24  MINUS,VOBCPU
         GEN,8,24  SAVEZERO,DBAT
**
         GEN,8,24  PLUS,VCPU
         GEN,8,24  MINUS,VOCPU
         GEN,8,24  SAVEZERO,DONL
**
         GEN,8,24  PLUS,VTIC
         GEN,8,24  MINUS,VOTIC
         GEN,8,24  DIVIDE,=500      INTERVAL IN SECONDS
         GEN,8,24  TIMES,VUAVE      APPROX USER LOGGED SECONDS
         GEN,8,24  DIVIDE,=10
         GEN,8,24  PLUS,VOSIT
         GEN,8,24  SAVEZERO,VSIT
*
         GEN,8,24  PLUS,C:RTRW+F
         GEN,8,24  SAVEZERO,VRTRW
*
         GEN,8,24  PLUS,C:MSB+F
         GEN,8,24  SAVEZERO,VBSR
*
         GEN,8,24  PLUS,C:MSO+F
         GEN,8,24  SAVEZERO,VLSR
*
         GEN,8,24  PLUS,VTIC
         GEN,8,24  TIMES,BATCH
         GEN,8,24  SAVEZERO,TICBAT
*
         GEN,8,24  PLUS,VTIC
         GEN,8,24  TIMES,VLUS
         GEN,8,24  SAVEZERO,TICUSR
*
*        DIVISORS FOR THIS GROUP DEFINED BY INSTRUCTIONS AT:
*                 ASUMRYN - FOR OVERALL STATISTICS IN SUMMARY
*                 ASUMRYO - FOR SAMPLE STATISTICS IN SUMMARY
*
* 1                                 # BATCH STREAMS
         GEN,8,24  PLUS,BATCH
         GEN,8,24  TIMES,=10
         GEN,8,24  NEXT,0
* 2                                 # ONLINE USERS
         GEN,8,24  PLUS,VLUS
         GEN,8,24  TIMES,=10
         GEN,8,24  NEXT,0
* 3                                 % CPU/BATCH USER
         GEN,8,24  PLUS,DBAT
         GEN,8,24  TIMES,=1000
         GEN,8,24  DIVIDE,DTIC
         GEN,8,24  DIVIDE,BATCH
         GEN,8,24  NEXT,0
* 4                                 % ONLINE USER
         GEN,8,24  PLUS,DONL
         GEN,8,24  TIMES,=1000
         GEN,8,24  DIVIDE,DTIC
         GEN,8,24  DIVIDE,VLUS
         GEN,8,24  NEXT,0
* 5                                 BATCH EXECUTION/SERVICE
         GEN,8,24  PLUS,C:SCB+F
         GEN,8,24  MINUS,C:MSB+F
         GEN,8,24  NEXT,0
* 6                                 ONLINE EXECUTION/SERVICE
         GEN,8,24  PLUS,C:SCO+F
         GEN,8,24  MINUS,C:MSO+F
         GEN,8,24  NEXT,0
* 7                                 CPU MSEC PER I/O
         GEN,8,24  PLUS,C:SCB+F     TOT BATCH TICS
         GEN,8,24  PLUS,C:SCO+F     +TOT ONLINE TICS
         GEN,8,24  TIMES,=2         *2=CPU MSEC
         GEN,8,24  NEXT,0
* 8                                 ONLINE TIME MIX
         GEN,8,24  PLUS,C:SCO+F     TOT ONLINE TICS
         GEN,8,24  MINUS,C:SCI+F    -INTERACTIVE TICS
         GEN,8,24  NEXT,0
* 9                                 ONLINE INTENSITY
         GEN,8,24  PLUS,C:SCO+F     ONLINE TICS
         GEN,8,24  TIMES,=60        *60 SECS
         GEN,8,24  NEXT,0
* 10                                TASKS PER MINUTE
         GEN,8,24  PLUS,VCIT        # TASKS
         GEN,8,24  TIMES,=60        *60 SECS
         GEN,8,24  NEXT,0
* 11                                % INTERACTIVE TASKS
         GEN,8,24  PLUS,VCITI       # INTERACTIVE TASKS
         GEN,8,24  TIMES,=100       *100 %
         GEN,8,24  NEXT,0
* 12                                90 % RESPONSE
         GEN,8,24  PLUS,C:RT90+F
         GEN,8,24  TIMES,=10
         GEN,8,24  NEXT,0
* 13                                TASK TURNAROUND
         GEN,8,24  PLUS,C:STT+F
         GEN,8,24  DIVIDE,=500      IN SECS
         GEN,8,24  NEXT,0
* 14                                ETMF FOR WHAT ITS WORTH
         GEN,8,24  PLUS,C:ETM+F
         GEN,8,24  TIMES,=10
         GEN,8,24  NEXT,0
         GEN,8,24  DONE,0
         PAGE
GROUP32  EQU      %
* 1               BATCH EXECUTION   SLAVE, MAPPED
         GEN,8,24  PLUS,C:SCB+F
         GEN,8,24  ADDTO,TOTAL
         GEN,8,24  MINUS,C:MSB+F
         GEN,8,24  NEXT,0
* 2               BATCH SERVICE     MASTER, MAPPED
         GEN,8,24  PLUS,C:MSB+F
         GEN,8,24  NEXT,0
* 3               ONLINE EXECUTION  SLAVE, MAPPED
         GEN,8,24  PLUS,C:SCO+F
         GEN,8,24  ADDTO,TOTAL
         GEN,8,24  MINUS,C:MSO+F
         GEN,8,24  NEXT,0
* 4               ONLINE SERVICE    MASTER, MAPPED
         GEN,8,24  PLUS,C:MSO+F
         GEN,8,24  NEXT,0
* 5               MONITOR SERVICE   MASTER, UNMAPPED
         GEN,8,24 DISP,MAXPAGE
         GEN,8,24 PLUS,J:OVHTIM-J:JIT+F
         GEN,8,24 PLUS,J:DELTAT-J:JIT+F
         GEN,8,24  ADDTO,TOTAL
         GEN,8,24 NEXT,0
* 6               IDLE
         GEN,8,24 PLUS,C:IDLE+F
         GEN,8,24  ADDTO,TOTAL
         GEN,8,24 NEXT,0
* 7               SWAP WAIT
         GEN,8,24 PLUS,C:IDLES+F
         GEN,8,24  ADDTO,TOTAL
         GEN,8,24 NEXT,0
* 8
         GEN,8,24  PLUS,C:IDLEW+F   I/O WAIT
         GEN,8,24  ADDTO,TOTAL
         GEN,8,24  NEXT,0
* 9
         GEN,8,24  PLUS,C:IDLESW+F  I/O WAIT & SWAP WAIT
         GEN,8,24  ADDTO,TOTAL
         GEN,8,24  NEXT,0
*10
         GEN,8,24  PLUS,TOTAL
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,VTIC
         GEN,8,24  SAVESUM,0
         GEN,8,24  DONE,0
         PAGE                        GET TABLES FOR % CPU ON-LINE PROC
GROUP34  EQU      %
         CPUSUM   C:SCO,1
         CPUSUM   C:SCO,2
         CPUSUM   C:SCO,3
         CPUSUM   C:SCO,4
         CPUSUM   C:SCO,5
         CPUSUM   C:SCO,6
         CPUSUM   C:SCO,7
         CPUSUM   C:SCO,8
         CPUSUM   C:SCO,9
         CPUSUM   C:SCO,10
         CPUSUM   C:SCO,11
*
         GEN,8,24  PLUS,C:SCO+F
         GEN,8,24  MINUS,TOTAL
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,VTIC
         GEN,8,24  SAVESUM,0
         GEN,8,24  DONE,0
         PAGE                        GET TABLES FOR PROCESSOR USERS
GROUP35  EQU      %
         STABLE   DBAS
         STABLE   DDEL
         STABLE   DEDI
         STABLE   DFDP
         STABLE   DFOR
         STABLE   DFORLIB
         STABLE   DLINK
         GEN,8,24  PLUS,LOGON
         GEN,8,24  NEXT,0
         STABLE   DMET
         STABLE   DPCL
         STABLE   DTEXT
* 12              USERS IN CORE
         GEN,8,24  FLAG,X'200'
         GEN,8,24  NEXT,0
*
         GEN,8,24 DONE,0
         PAGE                        GET TABLES FOR I/O RATES
GROUP36  EQU      %
         GEN,8,24  PLUS,C:CAL+F
         GEN,8,24 NEXT,0
* 2
         GEN,8,24 PLUS,C:CIT+F
         GEN,8,24 NEXT,0
* 3
         GEN,8,24 PLUS,C:CI+F
         GEN,8,24 NEXT,0
* 4
         GEN,8,24 PLUS,C:CO+F
         GEN,8,24 NEXT,0
* 6
         GEN,8,24  PLUS,C:CTW+F
         GEN,8,24  NEXT,0
* 5
         GEN,8,24 PLUS,C:RTRW+F
         GEN,8,24 NEXT,0
* 7
         GEN,8,24 PLUS,C:CSC+F
         GEN,8,24 NEXT,0
* 8
         GEN,8,24  PLUS,TDI2
         GEN,8,24  PLUS,INSWT
         GEN,8,24  SAVEZERO,INSWT
         GEN,8,24  PLUS,INSWT       GET ACCUMULATION OF INSWAPS
         GEN,8,24  NEXT,0
* 9
         GEN,8,24 PLUS,C:COS+F
         GEN,8,24  NEXT,0
**
         GEN,8,24  PLUS,VTIC
         GEN,8,24  SAVESUM,0
         GEN,8,24 DONE,0
         PAGE                        GET TABLES FOR TIMING AVERAGES
GROUP37  EQU      %
         GEN,8,24  PLUS,C:SIT+F     INTERACTION TIME
         GEN,8,24 DIVIDE,=500
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,C:ST+F
         GEN,8,24  DIVIDE,=500
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,C:STT+F
         GEN,8,24  DIVIDE,=500
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,C:SIT+F
         GEN,8,24  MINUS,C:ST+F     MINUS THINK/TYPE
         GEN,8,24  DIVIDE,=500
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,C:SRT+F
         GEN,8,24  TIMES,=2
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,C:SC+F
         GEN,8,24  TIMES,=2
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,C:CIT+F
         GEN,8,24  SAVESUM,0
         GEN,8,24  DONE,0
         PAGE
GROUP38  EQU      %                 QUEUE - COUNT STATE QUEUE TOTALS
         GEN,8,24  PLUS,VLUS
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,LOGON
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,BATCH
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,GHOSTS
         GEN,8,24  NEXT,0
*                 # INPUTTING
         GEN,8,24  STATQ,STI
         GEN,8,24  STATQ,STIO
         GEN,8,24  NEXT,0
*                 # OUTPUTTING
         GEN,8,24  STATQ,STOB
         GEN,8,24  STATQ,STOBO
         GEN,8,24  NEXT,0
*                 # COMPUTING
         GEN,8,24  STATQ,SEC
         GEN,8,24  STATQ,SBK
         GEN,8,24  STATQ,SON
         GEN,8,24  STATQ,SIR
         GEN,8,24  STATQ,STOC
         GEN,8,24  STATQ,SIOC
         GEN,8,24  STATQ,SIOC2
         GEN,8,24  STATQ,SC
         GEN,8,24  STATQ,SCU
         GEN,8,24  NEXT,0
*                 COMPUTE BOUND
         GEN,8,24  STATQ,SCOM
         GEN,8,24  STATQ,SBAT
         GEN,8,24  NEXT,0
*                 I/O USERS
         GEN,8,24  STATQ,SIOW
         GEN,8,24  STATQ,SIOIP
         GEN,8,24  STATQ,SIOIP2
         GEN,8,24  STATQ,SQA
         GEN,8,24  NEXT,0
*                 SLEEPING USERS
 GEN,8,24  STATQ,SW
         GEN,8,24  NEXT,0
         GEN,8,24  DONE,0
         PAGE
*GET TABLES FOR BATCH PERCENT CPU TIME BY PROCESSOR
GROUP33  CPUSUM   C:SCB,1
         CPUSUM   C:SCB,2
         CPUSUM   C:SCB,3
         CPUSUM   C:SCB,4
         CPUSUM   C:SCB,5
         CPUSUM   C:SCB,6
         CPUSUM   C:SCB,7
         CPUSUM   C:SCB,8
         CPUSUM   C:SCB,9
         CPUSUM   C:SCB,10
         CPUSUM   C:SCB,11
*
         GEN,8,24  PLUS,C:SCB+F
         GEN,8,24  MINUS,TOTAL
         GEN,8,24  NEXT,0
*
         GEN,8,24  PLUS,VTIC
         GEN,8,24  SAVESUM,0
         GEN,8,24  DONE,0
         PAGE
*POINTERS TO OUTPUT TEXTS FOR SIDINGS
ATEXT1   EQU      %-1
         DATUM    T1A,T1B,T1C,T1D,T1E,T1F
         DATUM    T1G,T1H,T1I,T1J,T1K,T1L,T1M,T1N
ATEXT2   EQU      %-1
         DATUM    T2A,T2B,T2C
         PAGE
*        HEADING AND SIDING POINTERS FOR DISPLAY GROUPS
ASIDE3   EQU      %-1
         DATUM    TSL31,TSL32,TSL33,TSL34
         DATUM    TSL35,TSL36,TSL37,TSL38
TSL31    DATUM    TS311,TS312,TS313,TS314
         DATUM    TS315,TS316,TS317,TS318
         DATUM    TS319,TS3110,TS3111,TS3112,TS3113,TS3114
TSL32    DATUM    TS321,TS322,TS323,TS324,TS325
         DATUM    TS326,TS327,TS328,TS329,TS3210
TSL33    DATUM    TS331,TS332,TS333,TS334,TS335
         DATUM    TS336,TS337,TS338,TS339,TS3310
         DATUM    TS3311,TS3312
TSL34    EQU      TSL33
TSL35    DATUM    TS351,TS352,TS353,TS354,TS355
         DATUM    TS356,TS357,TS358,TS359,TS3510
         DATUM    TS3511,TS3512
TSL36    DATUM    TS361,TS362,TS363,TS364,TS365
         DATUM    TS366,TS367,TS368,TS369
TSL37    DATUM    TS371,TS372,TS373,TS374,TS375,TS376
TSL38    DATUM    TS381,TS382,TS383,TS384,TS385
         DATUM    TS386,TS387,TS388,TS389,TS3810
AHEAD3   EQU      %-1
         DATUM    TH31,TH32,TH33,TH34
         DATUM    TH35,TH36,TH37,TH38
         PAGE
AHEAD4   EQU      %-1               POINTERS TO SYS DIST HEADINGS
         DATUM    TSC3,TB1,TS3,TB1  LINE 3 (REVERSE ORDER)
         DATUM    TSC2,TB1,TS2,TB1  LINE 2 (REVERSE ORDER)
         DATUM    TSC1,TB1,TS1,TB1  LINE 1 (REVERSE ORDER)
AHEAD4A  EQU      %-1               POINTERS TO PROC DIST HEADINGS
         DATUM    TSC3,TB1,TP3,TB1  LINE 3 (REVERSE ORDER)
         DATUM    TSC2,TB1,TP2,TB1  LINE 2 (REVERSE ORDER)
         DATUM    TPC1,TB1,TP1,TB1  LINE 1 (REVERSE ORDER)
ADIST4   EQU      %-1               POINTERS TO SYS SUMS
         DATUM    SDLO,SDLI
         DATUM    SDC,SDTT,SDT,SDIT,SDRT
ADIST4A  EQU      %-1               POINTERS TO PROC SUMS
         DATUM    SDLO+8,SDLI+8
         DATUM    SDC+8,SDTT+8,SDT+8,SDIT+8
ATOT4    EQU      %-1               SYSTEM DISTRIB TOTALS
         DATUM    TDLO,TDLI
         DATUM    TDC,TDTT,TDT,TDIT,TDRT
ATOT4A   EQU      %-1               PROC DISTRIB TOTALS
         DATUM    TDLO+1,TDLI+1,TDC+1,TDTT+1,TDT+1
ASUM4    EQU      %-1               SYSTEM/PROC RUNNING SUM POINTERS
         RES      13                ******FILL IN LATER*****
         PAGE
AHEAD5   EQU      %-1               POINTERS TO SWAP DISP HEADINGS
         DATUM    TOT3,TB1,TIN3,TB1  LINE 3 (REV ORDER)
         DATUM    TOT2,TB1,TIN2,TB1  LINE 2 (REV ORDER)
         DATUM    TOT1,TB1,TIN1,TB1  LINE 1 (REV ORDER)
ADIST5   EQU      %-1               POINTERS TO SNAPSHOT DISTRIB
         DATUM    SDI3,SDI2,SDI1,SDOT,SDOS   5 COLUMNS (REV ORDER)
ATOT5    EQU      %-1               SWAP DISTRIBUTION TOTALS
         DATUM    TDI3,TDI2,TDI1,TDOT,TDOS
ASUM5    EQU      %-1               SWAP RUNNING SUMS
         RESERVE  5
         PAGE
*CONTROL PARAMETER SIDINGS
TH30     STRINGC  ' PARAM '
T1A      STRINGC  'HOUR:MINUTES         '
T1B      STRINGC  'INTERVAL IN MINUTES  '
T1C      STRINGC  'MAX # BATCH USERS    '
T1D      STRINGC  'MAX # ONLINE USERS   '
T1E      STRINGC  'AVERAGE BATCH SIZE K '
T1F      STRINGC  'AVERAGE ONLINE SIZE K'
T1G      STRINGC  '# CHAR TERM BLOCK    '
T1H      STRINGC  '# CHAR TERM UNBLOCK  '
T1I      STRINGC  'MSEC W/O INTERRUPT   '
T1J      STRINGC  'MSEC SWAP QUANTUM    '
T1K      STRINGC  'AVE BATCH QUANTUM    '
T1L      STRINGC  'MSEC ONLINE COMPUTE  '
T1M      STRINGC  'COMPUTE QUEUE SHARING'
T1N      STRINGC  '                     '  DUMMY ENTRY
*USE VALUE SIDINGS
T2A      STRINGC  '# OF INTERACTIONS ='
T2B      STRINGC  'MINS SINCE STARTUP='
T2C      STRINGC  'NUMBER OF USERS   ='
         PAGE
*USE GROUP HEADERS & SIDINGS
TH31     STRINGC  ' SUMMARY              ALL    SNAP'
TS311    STRINGC  'BATCH STREAMS    '
TS312    STRINGC  'ONLINE USERS     '
TS313    STRINGC  '% CPU/BATCH USER '
TS314    STRINGC  '% CPU/ONLINE USER'
TS315    STRINGC  'BATCH EXEC/SERV  '
TS316    STRINGC  'ONLINE EXEC/SERV '
TS317    STRINGC  'CPU MSEC PER I/O '
TS318    STRINGC  'ONLINE TIME MIX  '
TS319    STRINGC  'ONLINE INTENSITY '
TS3110   STRINGC  'ONLINE TASKS/MIN '
TS3111   STRINGC  '% INTERACTIVE    '
TS3112   STRINGC  '90% RESPONSE MSEC'
TS3113   STRINGC  'TURNAROUND    SEC'
TS3114   STRINGC  'ETMF             '
*
TH32     STRINGC  ' CPU %         ALL  SNAP'
TS321    STRINGC  'BATCH EXEC  '
TS322    STRINGC  'BATCH SERV  '
TS323    STRINGC  'ONLINE EXEC '
TS324    STRINGC  'ONLINE SERV '
TS325    STRINGC  'MONITOR SERV'
TS326    STRINGC  'IDLE        '
TS327    STRINGC  'SWAP WAIT   '
TS328    STRINGC  'I/O WAIT    '
TS329    STRINGC  'I/O&SWP WAIT'
TS3210   STRINGC  'TOTAL       '
 PAGE
TH34     STRINGC  ' ONLINE %  ALL  SNAP'
CONTROLD CSECT    0
TS331    STRINGC  '        '
TS332    STRINGC  '        '
TS333    STRINGC  '        '
TS334    STRINGC  '        '
TS335    STRINGC  '        '
TS336    STRINGC  '        '
TS337    STRINGC  '        '
TS338    STRINGC  '        '
TS339    STRINGC  '        '
TS3310   STRINGC  '        '
TS3311   STRINGC  'USER    '
TS3312   STRINGC  'SHARED  '
         USECT    CONTROLP
TH35     STRINGC  ' USERS   #'
TS351    STRINGC  'BASIC  '
TS352    STRINGC  'DELTA  '
TS353    STRINGC  'EDIT   '
TS354    STRINGC  'FDP    '
TS355    STRINGC  'FORTRAN'
TS356    STRINGC  'FORTLIB'
TS357    STRINGC  'LINK   '
TS358    STRINGC  'LOADER '
TS359    STRINGC  'METASYM'
TS3510   STRINGC  'PCL    '
TS3511   STRINGC  'TEXT   '
TS3512   STRINGC  'IN CORE'
         PAGE
TH36     STRINGC  ' I/O PER MIN   ALL  SNAP'
TS361    STRINGC  'SERVICE REQ '
TS362    STRINGC  'INTERACTIONS'
TS363    STRINGC  'CHAR IN     '
TS364    STRINGC  'CHAR OUT    '
TS365    STRINGC  'TERM WRITES '
TS366    STRINGC  'I/O ACCESSES'
TS367    STRINGC  'SYMBIONT    '
TS368    STRINGC  'IN SWAPS    '
TS369    STRINGC  'OUT SWAPS   '
*
TH37     STRINGC  ' TASK       ALL   SNAP'
TS371    STRINGC  'INTERACT'
TS372    STRINGC  'THINK-TY'
TS373    STRINGC  'TURNARND'
TS374    STRINGC  'COMPLETE'
TS375    STRINGC  'RESPONSE'
TS376    STRINGC  'CPU   MS'
*
TH38     STRINGC  ' QUEUE    #'
TS381    STRINGC  'LOGGED  '
TS382    STRINGC  'LOGGING '
TS383    STRINGC  'BATCH   '
TS384    STRINGC  'GHOST   '
TS385    STRINGC  'TERM IN '
TS386    STRINGC  'TERM OUT'
TS387    STRINGC  'COMPUTE '
TS388    STRINGC  'COMP BND'
TS389    STRINGC  'I/O     '
TS3810   STRINGC  'SLEEP   '
TH33     STRINGC  ' BATCH %   ALL  SNAP'
         PAGE
*  LOG SIDING
         BOUND    8
TD1D     EQU      %-4
         STRINGC  '   <1'
         STRINGC  '   <2'
         STRINGC  '   <5'
         STRINGC  '  <10'
         STRINGC  '  <20'
         STRINGC  '  <50'
         STRINGC  ' <100'
         STRINGC  ' <200'
         STRINGC  ' <500'
         STRINGC  '  <1K'
         STRINGC  '  <2K'
         STRINGC  '  <5K'
         STRINGC  ' <10K'
         STRINGC  '  &UP'
*  LINEAR SIDING
TD4A     EQU      %-4
         STRINGC  '   <5'
         STRINGC  '  <10'
         STRINGC  '  <15'
         STRINGC  '  <20'
         STRINGC  '  <25'
         STRINGC  '  <30'
         STRINGC  '  <35'
         STRINGC  '  <40'
         STRINGC  '  <45'
         STRINGC  '  <50'
         STRINGC  '  <55'
         STRINGC  '  <60'
         STRINGC  '  <65'
         STRINGC  '  &UP'
         PAGE
TD5C     EQU      %-4
         STRINGC  '   =0'
         STRINGC  '   =1'
         STRINGC  '   =2'
         STRINGC  '   =3'
         STRINGC  '   =4'
         STRINGC  '   =5'
         STRINGC  '   =6'
         STRINGC  '   =7'
         STRINGC  '   =8'
         STRINGC  '   =9'
         STRINGC  '  =10'
         STRINGC  '  =11'
         STRINGC  '  =12'
         STRINGC  '  &UP'
         PAGE
TB1      STRINGC  '     '
*
TS1      STRINGC  '<--------SYSTEM--------->'
TS2      STRINGC  ' RESP INTR TYPE TURN  CPU'
TS3      STRINGC  '   MS  SEC  SEC  SEC   MS'
*
TSC1     STRINGC  '<-SYSTEM->'
TSC2     STRINGC  ' INLN OTLN'
TSC3     STRINGC  ' CHAR CHAR'
*
TP1      STRINGC  '<--PROCESSOR-->'
TP2      STRINGC  ' TYPE TURN  CPU'
TP3      STRINGC  '  SEC  SEC   MS'
*
TPC1     STRINGC  '<PROCESS->'
*
TIN1     STRINGC  '<--OUT SWAP--->'
TIN2     STRINGC  '            TOT'
TIN3     STRINGC  '#USERS       MS'
*
TOT1     STRINGC  '<---IN SWAP--->'
TOT2     STRINGC  '  JIT REST  TOT'
TOT3     STRINGC  '   MS   MS   MS'
         PAGE                        TEXT FOR SPECIAL PRINTOUTS
AT3      STRINGC  ' INTERVAL FROM '
AT4      STRINGC  ' TO '
AT11     STRINGC  ' RECORD # '
AT12     STRINGC  ', '
AT13     STRINGC  ' STATISTICS ON-LINE '
AT14     STRINGC  ' PARAMETERS AT '
AT15     STRINGC  ' STARTED'
AT16     STRINGC  ' ADAM HISTORY FILE '
AT21     STRINGC  'STATS SNAPSHOT FILES STARTED'
AT22     STRINGC  'STATS SNAPSHOT FILES COMPLETED'
AT23     STRINGC  'STATS SNAPSHOT.:STATS FILE ERROR'
AT24     STRINGC  'STATS SSNAPSHOT.:STATS FILE ERROR'
AT18     STRINGC  'GHOSTSI FILE ERROR - RESTART'
AT19     STRINGC  'GHOSTDO FILE ERROR - RESTART'
AT20     STRINGC  'GHOSTLO FILE ERROR - RESTART'
NTAVL    STRINGC  '  N/A'
OFF      STRING   '  -      OFF'
ON       STRING   '  -  ON     '
YES      STRINGC  'YES'
NO       STRINGC  'NO'
TOT4     STRINGC  ' TOT#'
6YES     STRINGC  '   YES'
6NO      STRINGC  '    NO'
         PAGE                        NAMES OF ITEMS
         BOUND    8
ATERM1   EQU      %-2
         STRING   'PARAM   '
ATERM2   EQU      %-2
         STRING   'C:CIT   '
         STRING   'C:TIC   '
         STRING   'S:CUIS  '
ATERM3   EQU      %-2
         STRING   'SUMMARY '
         STRING   'CPU     '
         STRING   'BATCH   '
         STRING   'ONLINE  '
         STRING   'USERS   '
         STRING   'I/O     '
         STRING   'TASK    '
         STRING   'QUEUE   '
ATERM4   EQU      %-2
         STRING   'SYSTEM  '
         STRING   'PROC    '
ATERM5   EQU      %-2
         STRING   'SWAP    '
ATERM6   EQU      %-1
         STRING   'SNAPSHOT'
END      STRING   'REPORT  '
#SUSE    EQU      DA(ATERM3)-DA(ATERM2)
#GRP     EQU      DA(ATERM4)-DA(ATERM3)
#PRTFLGS EQU      DA(END)-DA(ATERM1)
#HIS     EQU      2                 SYSTEM PLUS ONE PROCESSOR
         PAGE                        LISTS FOR SET UP COMMAND
FLAGP    EQU      %
         DATUM    FLAGS0,FLAGS1,FLAGS2,FLAGS3,FLAGS4
         DATUM    FLAGS5
FLAGS0   DATUM    0
         BOUND    8
FLAGS1   STRING   'SYSTEM  '
         DATUM    0
         BOUND    8
FLAGS2   STRING   'SYSTEM  '
         STRING   'PROC    '
         DATUM    0
         BOUND    8
FLAGS3   STRING   'ONLINE  '
         STRING   'USERS   '
         STRING   'I/O     '
         STRING   'TASK    '
         STRING   'QUEUE   '
         STRING   'BATCH   '
         DATUM    0
         BOUND    8
FLAGS4   STRING   'SUMMARY '
         STRING   'CPU     '
         DATUM    0
         BOUND    8
FLAGS5   STRING   'SWAP    '
         DATUM    0
         BOUND    8
ALL      STRING   'ALL     '
SNAPS    STRING   'SNAPSHOT'        WRITE SNAPSHOT FILES
PRINS    STRING   'REPORT  '        WRITE SNAPSHOT REPORT
FEND     STRING   'END '
         USECT    CONTROLD
         PAGE                        DATA AREA
*FLAGS AND OTHER VARIABLES
SAD      GEN,8,24 X'07',0
         DATUM    G                 FIRST PAGE FOR MONITOR MAPPING
GVP      GEN,8,24 X'04',F           GET PAGE FOR BUFFER.
IMAPF    DATUM    0                 FLAG SET IF MONITOR PAGES ARE MAPPED
IVIRF    DATUM    0                 FLAG SET IF VIRTUAL PAGES GOTTEN
ISKPF    DATUM    0                 FLAG SET TO SKIP MONITOR MAP
FCEXC    DATUM    0                 FLAG; 1 IF C! IN PROCESS
DEPTH    RES      1
TOTAL    RES      1
VDISP    RES      1
MDEPTH   DATUM    0
VINT     DATA     0                 SNAPSHOT INTERVAL IN SECONDS
VMIN     DATA     0                 SNAPSHOT INTERVAL IN MINUTES
VTIME    DATUM    0                 LAST TIME IN BCD
VTIME2   DATUM    0                 BINARY;LAST TIME
DTIME    STRINGC  '                '     OLD TIME/DATE
         DATUM    16                BYTE COUNT FOR TIME
TIME     STRING   '                '     CURRENT TIME
TIME1    DATA     0
TIME2    DATA     0
TIME3    DATA     0
VHRMN    DATA     0
VSIZE    DATUM    0           BINARY;SIZE OF NAME OR STRING.
VSCALE   DATUM    0
VBINARY  DATUM    0
VBUFCNT  DATA     1                 CHARACTER COUNT IN BUFFER
TEMP     DATUM    0
LCOUNT   DATA     0                 SI LINE COUNT
PROCFLG  DATUM    0
ISNAP    DATUM    0                 # OF SNAPSHOTS DESIRED
ICOUNT   DATUM    0                 SNAPSHOT INDEX=1,...,C(ISNAP)
NKEY     STRINGC  '               '
BFLG     DATUM    0                 BREAK FLAG=-1 IF BREAK OCCURRED.
PSDWZ    DATUM    0                 TCB/PSD WORD 0 POINTER
LINK     DATUM    0                 SUBROUTINE LINK LOCATION
LINK1    DATA     0                 TEMP SUBROUTINE LINKAGE
GHOSTS   DATUM    0                 TEMP FOR # OF GHOST JOBS
BATCH    DATA     0                 TEMP # OF BATCH USERS
LOGON    DATUM    0                 TEMP FOR LOGON PROCESSOR
LOGOFF   DATUM    0                 TEMP FOR # LOGGING OFF
NLINK    DATUM    0                 TEMP FOR # USING LINK
ABQUAN   DATA     0                 CURRENT AVERAGE BATCH QUAN
TOTVIR   DATA     0                 TOTAL VIRTUAL STORAGE
CITER    DATUM    0                 INTERACTION TIME ERROR
CTYER    DATUM    0                 THINK-TYPE ERROR
NLINE    DATA     0                 LINE COUNTER
TICBAT   DATA     0
TICUSR   DATA     0
DTIC     DATA     0                 TICS IN INTERVAL
DBAT     DATA     0                 BATCH EXEC+SERV IN INTERVAL
DONL     DATA     0                 ONLINE EXEC+SERV IN INTERVAL
AVBATP   DATA     0                 AVERAGE # PAGES PER BATCH USER
AVONLP   DATA     0                 AVERAGE # PAGES PER ONLINE USER
ISNF     DATUM    0                 FLAG SET IF SNAPSHOTS BEING PRINTED
SNAPF    DATUM    0                 WRITE SNAPSHOT FILES
PRNTF    DATUM    0                 PRINT STATISTICAL REPORT
RFLG     DATA     0                 FLAG SET WHEN WRITING
INSWT    DATA     0                 ACCUM OF INSWAPS
ONE      STRING   '1   '
MAXPAGE  DATUM    0
         DATUM    SL:TB+X'200'
         DATUM    C:LAST+X'1FF'
         DATUM    PBT:LOCK+X'207'
         DATUM    UB:PCT+X'23F'
         DATUM    PLH:QN+X'200'
NOMAXS   EQU      %-MAXPAGE-1
         PAGE
* SNAPSHOT SUMMARY BUFFER FOR HISTORY FILE PROCESSING.
SNAPSUM  EQU      %                 SNAPSHOT BUFFER
SNTIME   RES      5                 TEXTC TIME/DATE OF SNAPSHOT
SDIM     DATUM    STOTB             LENGTH OF SNAPSHOT BUFFER IN BYTES
         DATUM    D30
         DATUM    D31,D32,D33,D34,D35,D36,D37,D38
SCONT    EQU      %-1
         RESERVE  D30
SNAPSUM2 EQU      %-1
         RESERVE  DT
*        SNAPSHOT DISTRIBUTIONS - SYSTEM ONLY
SDIST    RESERVE  8*12
SPNAME   RESERVE  20                PROCESSOR NAMES
SMONDES  RESERVE  1                 MONITOR DESIGNATOR, UTSTM AB.01
STOT     EQU      %-SNAPSUM
STOTB    EQU      4*STOT            SNAPSHOT BUFFER BYTE COUNT
         PAGE
LEOM     RESERVE  128               ONE WORD PER LINE
BUFFER   DO1      6
         STRING   '                    '     20 BLANKS
         BOUND    8
COMMAND  DO1      4                 COMMAND INPUT BUFFER
         STRING   '                    '     20 BLANKS
DECIMAL  DO1      4                 DECIMAL DATA INPUT BUFFER
         STRING   '                    '     20 BLANKS
         BOUND    8
NAME     DO1      4                 SET UP 80 CHAR BUFFER
         STRING   '                    '     20 BLANKS
BNAME    EQU      NAME              TO AVOID PROC CONFUSION WITH 'NAME'
NUMBER   DATUM    0,0,0,C'    '
PATCH    RESERVE  20
         PAGE                        PRINT FLAGS
APRIN    EQU      %-1
APRIN1   DATA     0
APRIN2   EQU      %-1
         RESERVE  #SUSE
APRIN3   EQU      %-1
         DATUM    1,1
         RESERVE  #GRP-2
APRIN4   EQU      %-1
         RESERVE  2                 SYSTEM AND ONE PROCESSOR
APRIN5   EQU      %-1
         DATA     0                 SWAPS
APRIN6   EQU      %-1
ISNAPF   DATUM    0                 'SNAPSHOT' ADDED
IPRNTF   DATUM    0                 'REPORT' ADDED
         PAGE
AOLD2    EQU      %-1
         RESERVE  #SUSE
AOLD3    EQU      %-1
         RESERVE  DT
ANEW1    EQU      %-1
         RESERVE  D30
ANEW2    EQU      %-1
         RESERVE  #SUSE
ANEW3    EQU      %-1
         RESERVE  DT
ASAVE3   EQU      %-1
         RESERVE  #GRP              ONE PER USE GROUP
ASUMN3   EQU      %-1
         RESERVE  #GRP              ONE PER USE GROUP
ASUMO3   EQU      %-1
         RESERVE  #GRP              ONE PER USE GROUP
         PAGE
*        OLD HALFWORD DISTRIBUTION FOR SYSTEM AND PROCESSORS
ODI1     RESERVE  8
ODI2     RESERVE  8
ODI3     RESERVE  8
ODOT     RESERVE  8
ODOS     RESERVE  8
ODRT     RESERVE  8
ODIT     RESERVE  8
ODTT     RESERVE  8*#HIS
ODT      RESERVE  8*#HIS
ODC      RESERVE  8*#HIS
ODLI     RESERVE  8*#HIS
ODLO     RESERVE  8*#HIS
*        DIFFERENCE HALFWORD DISTRIBUTIONS FOR SYSTEM AND PROCESSORS
SDI1     RESERVE  8
SDI2     RESERVE  8
SDI3     RESERVE  8
SDOT     RESERVE  8
SDOS     RESERVE  8
SDRT     RESERVE  8
SDIT     RESERVE  8
SDTT     RESERVE  8*#HIS
SDT      RESERVE  8*#HIS
SDC      RESERVE  8*#HIS
SDLI     RESERVE  8*#HIS
SDLO     RESERVE  8*#HIS
         PAGE
*        SNAPSHOT DISTRIBUTION TOTALS
TDI1     RESERVE  1
TDI2     RESERVE  1
TDI3     RESERVE  1
TDOT     RESERVE  1
TDOS     RESERVE  1
TDRT     RESERVE  1
TDIT     RESERVE  1
TDTT     RESERVE  #HIS
TDT      RESERVE  #HIS
TDC      RESERVE  #HIS
TDLI     RESERVE  #HIS
TDLO     RESERVE  #HIS
*        OLD SUMS FOR OVERALL HISTOGRAM AVERAGE
OCOS     RESERVE  1
OSRT     RESERVE  1
OSIT     RESERVE  1
OSTT     RESERVE  #HIS
OST      RESERVE  #HIS
OSC      RESERVE  #HIS
OCI      RESERVE  #HIS
OCO      RESERVE  #HIS
*        SNAPSHOT SUMS FOR SNAPSHOT HISTOGRAM AVERAGE
DCOS     RESERVE  1
DSRT     RESERVE  1
DSIT     RESERVE  1
DSTT     RESERVE  #HIS
DST      RESERVE  #HIS
DSC      RESERVE  #HIS
DCI      RESERVE  #HIS
DCO      RESERVE  #HIS
         PAGE
*INDIVIDUAL VALUES DERIVED FROM MONITOR AREA
VUAVE    DATA     0                 AVERAGE OF VLUS,VOLUS
DISPS    EQU      %-1               ENTRY NUMBER OF PROCESSOR
DBAS     RES      1                 IN MONITOR TABLE
DDEL     RES      1                 VALUES ARE DETERMINED
DEDI     RES      1                 IN THE INITIALIZATION
DFDP     RES      1                 FORTRAN DEBUG PACKAGE #
DFOR     RES      1
DFORLIB  RES      1                 FORTRAN LIBRARY
DLINK    RES      1
DLOAD    RES      1
DLOGON   RES      1
DMET     RES      1
DPCL     RES      1
DTEXT    DATA     0
DUSE     DATA     ENDPMPRC+1
         PAGE
*        NEW DATA                   TEMPORARY STORAGE
VCIT     DATA     0
VCITI    DATA     0
VLUS     DATA     0
VSCI     DATA     0
VSEC     DATA     0
VSIT     DATA     0
VTIC     DATA     0
VTYP     DATA     0
VRTRW    DATA     0                 9
VBAT     DATA     0                 # OF BATCH USER
VUSE     DATA     0                 # OF ONLINE USERS
VBSR     DATA     0                 BATCH CPU SERVICE
VLSR     DATA     0                 ONLINE CPU SERVICE
VBCPU    DATA     0                 BATCH EXECUTION + SERVICE
VCPU     DATA     0                 ONLINE EXECUTION + SERVICE
*        OLD DATA                   TEMPORARY STORAGE
VOCIT    DATA     0
VOCITI   DATA     0
VOLUS    DATA     0
VOSCI    DATA     0
VOSEC    DATA     0
VOSIT    DATA     0
VOTIC    DATA     0
VOTYP    DATA     0
VORTRW   DATA     0
VOBAT    DATA     0
VOUSE    DATA     0
VOBSR    DATA     0
VOLSR    DATA     0
VOBCPU   DATA     0
VOCPU    DATA     0
         PAGE                        DECIMAL SUBROUTINE
         USECT    CONTROLP          PURE PROCEDURE SECTION
* APPROACH: THIS SUBROUTINE PICKS UP THE ONES POSITION, CONVERTS
* IT TO BINARY, MULTIPLIES IT BY 1 AND ADDS IT TO VBINARY.
* THEN IT PICKS UP THE TENS POSITION, MULTIPLIES IT BY 10 AND
* ADDS IT TO VBINARY. ECT.
* FUNCTION: TO INPUT AN UNSIGNED INTEGER FROM THE
* TERMINAL AND CONVERT IT TO BINARY. THE RESULT IS STORED IN VBINARY.
* ERROR RETURN: IF NO NUMBER IS INPUT OR IF OTHER
* THAN DECIMAL CHAR. IS INPUT.
SDEC     LI,1     60                BYTE COUNT, DECIMAL INPUT
         LI,2     DECIMAL
         BAL,ERETURN  READSI
         LW,RI2   R4                GET POINTER TO LAST CHARACTER
         LI,R     1                 VSCALE=1.
         STW,R    VSCALE
         LI,R     0                 VBINARY=0.
         STW,R    VBINARY
SDEC1    LB,R+1   DECIMAL,RI2 BIN.=BIN.+DECIMAL(RI2)*VSCALE.
         CI,R1    C'0'              IF CHAR NOT A DIGIT,
         BL       0,RETURN          ERROR RETURN.
         CI,R1    C'9'
         BG       0,RETURN
         AND,R1   =X'F'             CONVERT CHAR. TO BINARY.
         MW,R     VSCALE
         AW,R+1   VBINARY
         STW,R+1  VBINARY
         LW,RI2   RI2               IF RI2=0 THEN GOTO SDEC2.
         BEZ      1,RETURN          NORMAL RETURN
         AI,RI2   -1                RI2=RI2-1.
         LI,R+1   10                VSCALE=VSCALE*10.
         MW,R     VSCALE
         STW,R+1  VSCALE
         B        SDEC1
         PAGE                       NAME SUBROUTINE
* FUNCTION: TO PROMPT FOR A STRING(OFTEN AN ITEM NAME)
* FROM THE TERMINAL, TO INPUT THE NAME INTO A PLACE
* CALLED NAME. THE LENGTH OF THE NAME GOES INTO VSIZE.
SNAME    EQU      %
         LD,R2    BLANK
         STD,R2   BNAME             STORE BLANKS IN FIRST 8 CHAR
         LI,R1    80                BYTE COUNT
         LI,R2    BNAME
         BAL,ERETURN  READSI
         CI,R4    0
         BL       0,RETURN          RETURN IF NAME ZERO LENGTH
         AI,R4    1                 BYTE BIAS-->BYTE COUNT
         STW,R4   VSIZE             STORE BYTE COUNT
         B        1,RETURN          NORMAL RETURN
         PAGE
READSI   M:READ   M:SI,(BUF,*R2),(SIZE,*R1),(ABN,SIER),(ERR,SIER)
         MTW,1    LCOUNT
         LW,R4    M:SI+4
         SLS,R4   -17
         CI,R4    -1
         BNE      %+2
         LW,R4    M:SI+13                NO - GET BUFFER SIZE
SNAME1   AI,R4    -1
         CI,R4    0
         BL       SNAME3
         LB,R3    *R2,R4
         CI,R3    X'15'
         BE       SNAME2            STRIP NEW LINE CHAR
         CI,R3    X'0D'
         BE       SNAME2            STRIP CARRIAGE RETURN
         CI,R3    X'40'
         BE       SNAME1            STRIP BLANK
SNAME3   LW,R3    LCOUNT
         CI,R3    1                 IS THIS LINE 1
         BG       %+4               NO - SKIP CONTROL CARD TEST
         LW,R3    *R2               LOAD FIRST FOUR CHAR
         CW,R3    =C' STA'          TEST FOR STATS CONTROL CARD
         BE       READSI            READ NEXT COMMAND
*        BUFFER, R4 POINTS TO RIGHTMOST NON-BLANK AND NOT NEW LINE
*        IF M:SI IS A FILE,ECHO M:SI VIA M:DO
         LW,R3    M:SI
         AND,R3   =X'00000007'
         CI,R3    1
         BNE      0,ERETURN         RETURN IF NOT A FILE
         LW,R3    R4
         AI,R3    1
         M:DEVICE  M:DO,(NOVFC)
         M:WRITE  M:DO,(BUF,*R2),(SIZE,*R3),(BTD,0)
         M:DEVICE  M:DO,(VFC)
         B        0,ERETURN         NORMAL RETURN
SNAME2   LI,R3    C' '
         STB,R3   *R2,R4            STORE BLANK OVER OLD CHAR
         B        SNAME1
SIER     EQU      %                 ERROR RETURN
         LB,R1    R10
         CI,R1    X'07'
         BE       READSI+1          NORMAL RETURN - TRUNCATED INPUT
         B        LEXIT
         PAGE
*FIND ENTRY NO. OF NAME SUBROUTINE
* FUNCTION: TO DETERMINE THE ENTRY NUMBER OF NAME IN
* NAME. THE ENTRY NO. CAN THEN BE USED TO ACCESS TABLES
* PARALLEL TO THE ITEMS LIST.
* RESULT: THE ENTRY NO. ENDS UP IN RI.
* ERROR RETURN: IF THE NAME IS NOT FOUND.
SFIND    LD,R12   BNAME             GET FIRST 8 CHAR
         LI,RI    #PRTFLGS
         CD,R12   ATERM1,RI
         BE       1,RETURN          NORMAL RETURN
         BDR,RI   %-2
         B        *RETURN           ERROR RETURN
         PAGE
*CONVERT AND OUTPUT BINARY NUMBER SUBROUTINE
* FUCTION: TO CONVERT A BINARY NO. TO A DECIMAL NUMBER
* OF A SPECIFIED LENGTH AND APPEND IT TO AN OUTPUT
*   R1= NO. OF CHARACTERS TO BE APPENDED TO BUFFER.
*   R2=BINARY NO. TO BE CONVERTED AND APPENDED.
SBINOUT  LW,R15   R2          BININT=R2.
         STW,1    VSIZE
         LW,R     BLANK       SET DECIMAL NUMBER TO BLANKS.
         STW,R    NUMBER
         STW,R    NUMBER+1
         STW,R    NUMBER+2
         LI,R2    11          I=11.
SBIN1    AI,R2    -1          I=I-1.
         LI,R14   0           BININT=BININT/10.
         DW,R14   =10         NUMBER(I)=REMAINDER CONVERTED
         OR,R14   =X'F0'        TO A CHARACTER.
         STB,R14  NUMBER,R2
         CI,R15   0           WAS RESULT 0?
         BNE      SBIN1       IF NO, GOTO SBIN1.
         CI,R14   X'F0'       WAS REMAINDER 0?
         BNE      SBIN2       IF NO, GO TO SBIN2.
         CI,R2    10
         BE       SBIN2
         LI,R     C' '        BLANK OUT LEADING ZERO.
         STB,R    NUMBER,R2
         AI,R2    1           I=I+1.
SBIN2    EQU      %
SBIN3    LI,R2    11                R2=INDEX TO FIRST CHAR.
         SW,R2    VSIZE             OF NUMBER IN NUMBER.
SBIN4    LW,R12   VSIZE             R12=SIZE.
         LI,R1    NUMBER            R1=BYTE ADDRESS OF
         SLS,R1   2                 FIRST CHAR.-1.
         AW,R1    R2
         AI,R1    -1
         LI,R13   0
         B        SOUTAX
         PAGE                       OUTPUT TEXT SUBROUTINE
SOUTA    LI,R13   0
         SLS,R1   2                 R1=BYTE ADDRESS OF STRING
         LB,R12   0,R1              R12=LENGTH OF STRING
SOUTAX   AW,R12   R1                R12=BYTE ADDRESS OF LAST CHAR.
         LW,R2    VBUFCNT           R2=INDEX TO NEXT CHAR. OF BUFFER
SOUTA1   CI,R2    120               IF BUFFER IS FULL
         BGE      SOUTA2                 TRUNCATE INPUT
         AI,R1    1                 INCREMENT SOURCE POINTER
         CW,R1    R12
         BG       SOUTA2
         LB,R     0,R1              GET CURRENT CHAR. FROM STRING
         STB,R    BUFFER,R2         AND APPEND TO BUFFER.
         AI,R2    1
         B        SOUTA1
SOUTA2   STW,R2   VBUFCNT
         CI,R13   1                 IF R13=1 GO TO OUTPUTING
         BE       SEND              THE BUFFER
         B        0,RETURN          NORMAL RETURN.
         PAGE
*APPEND BLANKS TO BUFFER SUBROUTINE
*PUT N BLANKS IN THE BUFFER
*R1=NO. OF BLANKS
*VBUFCNT=PTER TO WHERE NEXT CHAR GOES IN BUFFER.
SBLANK   LI,R     X'40'
         LW,R2    VBUFCNT           LOAD INDEX TO OUTPUT BUFFER.
SBLANK1  STB,R    BUFFER,R2         APPEND A BLANK TO THE BUFFER.
         AI,R2    1                 INCREMENT INDEX TO OUTPUT BUFFER.
         BDR,R1   SBLANK1
         STW,R2   VBUFCNT           STORE INDEX TO OUTPUT BUFFER.
         B        0,RETURN
         PAGE
*        THIS SUBROUTINE POSITIONS M:LO TO NEW PAGE
*        UNLESS SNAPSHOTS ARE BEING SUPPRESSED
SPAGE    MTW,0    PRNTF
         BEZ      *RETURN
         STW,RETURN  LINK1
         LW,R     NLINE             # OF LINES PRINTED.
         CI,R     17                HAVE 17 LINES BEEN PRINTED..
         BL       SPAGE1            NO NEW PAGE
         M:WRITE  M:LO,(BUF,ONE),(SIZE,1)
         LI,R     1
         STW,R    VBUFCNT
         LI,R     BLANK
         STW,R    BUFFER
         LI,R     0
         STW,R    NLINE
         B        *LINK1            RETURN
SPAGE1   M:WRITE  M:LO,(BUF,BLANK),(SIZE,2)     TRY TO SKIP A LINE
         MTW,1    NLINE
         LI,R     1                 BLANKS IN FIRST CHARACTER
         STW,R    VBUFCNT
         LW,R1    BLANK
         STW,R1   BUFFER
         B        *LINK1
         PAGE                       OUTPUT BUFFER SUBROUTINE
SEND     MTW,0    PRNTF
         BEZ      SENDN
         LI,R     1
         CW,R     VBUFCNT
         BGE      *RETURN           SKIP WRITE IF ONE CHAR OR LESS
         MTW,1    NLINE             INCREMENT LINE COUNT
,OUTLIST M:WRITE  M:LO,(BUF,BUFFER),(SIZE,*VBUFCNT)
SENDN    LW,R     BLANK
         STW,R    BUFFER
         LI,R     1
         STW,R    VBUFCNT           STRING CAN BE CONSTRUCTED
         B        *RETURN
         PAGE
*INSERT PERIOD BEFORE LAST CHAR. IN BUFFER SUBROUTINE.
* INSERT DECIMAL POINT BEFORE LAST CHAR. IN BUFFER SUBROUTINE.
SPD      LW,RI1   VBUFCNT           RI1=INDEX TO LAST CHAR AVAIL
         AI,RI1   -2
         LB,R     BUFFER,RI1        GET NEXT TO LAST CHAR.
         AI,RI1   1                 RI1=INDEX TO LAST CHAR IN BUFFER.
         CI,R     C'E'              IF NEXT TO LAST CHAR.=E,
         BE        SDOT1            GO TO SPOT1.
         LB,R     BUFFER,RI1        GET LAST CHAR OF BUFFER.
         LI,R12   C'.'              REPLACE LAST CHAR WITH PERIOD
         STB,R12  BUFFER,RI1
         AI,RI1   1
         STB,R    BUFFER,RI1        PUT OLD LAST CHAR. AFTER PERIOD.
         AI,RI1   1                 INCREMENT INDEX TO BUFFER
         STW,RI1  VBUFCNT           AND SAVE.
         B        0,RETURN
SDOT1    LB,R     BUFFER,RI1
         AI,R     -1
         STB,R    BUFFER,RI1
         LW,R12   VSIZE
         LW,R1    VBUFCNT
         LW,R2    R1
SDOT2    AI,R2    -1
         LB,R     BUFFER,R2
         STB,R    BUFFER,R1
         AI,R1    -1
         BDR,R12  SDOT2
         LI,R     C' '
         STB,R    BUFFER,RI1
         LW,R     VBUFCNT
         AI,R     1
         STW,R    VBUFCNT
         B         0,RETURN
         PAGE
* GET CURRENT TIME IN SECONDS SENSE SYSTEM STARTUP
* RESULT (ROUNDED TO NEAREST SECOND) IN R1
STIME    EQU      %
         LI,R     0                 SET UP DOUBLE WORD FOR DIVIDE
         LI,R1    30
         SW,R1    C:TINC+G
         AW,R1    C:TIC+G
         AI,R1    500/2             ANTICIPATE TRUNCATION FOR ROUND
         DW,R     =500              CONVERT TO SECONDS
         B        *ERETURN
* GET CURRENT TIME IN MILLISECONDS SINCE SYSTEM STARTUP
* RESULT IN R1 (BASED UPON 500 HZ CLOCK)
STIMES   EQU      %
         LI,R1    30
         SW,R1    C:TINC+G
         AW,R1    C:TIC+G
         SAS,R1   1                 CONVERT TO MILLISECONDS
         B        0,ERETURN
         PAGE
USNAP    MTW,0    SNAPF             TEST SNAPSHOT FILE FLAG
         BEZ      *RETURN
         LB,R1    J:JIT             GET BYTE (0) OF USERS'S JIT
         CI,R1    X'40'             IS THIS A GHOST JOB
         BAZ      USNAP1
         B        USNAPG1
USNAP1   M:OPEN   F:2,(CONSEC),(SEQUEN),(INOUT),(SAVE),;
                  (ABN,OSE1)
         M:PFIL   F:2,(EOF)
USNAP2   M:OPEN   F:3,(KEYED),(DIRECT),(INOUT),(SAVE),;
                  (ABN,OSE4)
*        SNAPSHOT FILES NOW OPEN FOR UPDATE UNTIL HISTORY COMPLETED
         TYPE     ' SNAPSHOT FILES OPENED'
         B        *RETURN
*
OSE1     LB,R1    R10               RETRIEVE ABNORMAL CODE
         CI,R1    X'03'
         BE       OSE2              FILE DOES NOT EXIST - CREATE IT
         CI,R1    X'2E'
         BE       OSE2+1            FILE ALREADY OPEN - CLOSE IT
         TYPE     'CONSECUTIVE SNAPSHOT FILE ERROR'
         B        LSTAR
*
OSE2     M:OPEN   F:2,(CONSEC),(SEQUEN),(OUT),(SAVE)
         M:CLOSE  F:2,(SAVE)        FILE CREATED
         B        USNAP1            RE-TRY OPEN F:2 FOR UPDATE
*
OSE4     LB,R1    R10               RETRIEVE ABNORMAL CODE
         CI,R1    X'03'
         BE       OSE5              FILE DOES NOT EXIST - CREATE IT
         CI,R1    X'2E'
         BE       OSE5+1            FILE ALREADY OPEN - CLOSE IT
         TYPE     'KEYED SNAPSHOT FILE ERROR'
         B        LSTAR
*
OSE5     M:OPEN   F:3,(KEYED),(DIRECT),(OUT),(SAVE)
         M:CLOSE  F:3,(SAVE)        FILE CREATED
         B        USNAP2            RE-TRY OPEN F:3 FOR UPDATE
USNAPG1  M:OPEN   F:2,(FILE,'SNAPSHOT',':STATS'),(INOUT),(SAVE),;
                  (ABN,OSG1),(CONSEC),(SEQUEN)
         M:PFIL   F:2,(EOF)
USNAPG2  M:OPEN   F:3,(FILE,'SSNAPSHOT',':STATS'),(INOUT),(SAVE),;
                  (ABN,OSG4),(KEYED),(DIRECT)
         M:TYPE   (MESS,AT21)
         B        *RETURN
OSG1     LB,R1    R10               RETRIEVE ABNORMAL CODE
         CI,R1    X'03'
         BE       OSG2
         CI,R1    X'2E'
         BE       OSG2+1            FILE ALREADY OPEN - CLOSE IT
         M:TYPE   (MESS,AT23)
         B        LSTAR
*
OSG2     M:OPEN   F:2,(FILE,'SNAPSHOT',':STATS'),(OUT),(SAVE),;
                  (CONSEC),(SEQUEN)
         M:CLOSE  F:2,(SAVE)
         B        USNAPG1
*
OSG4     LB,R1    R10               RETRIEVE ABNORMAL CODE
         CI,R1    X'03'
         BE       OSG5              FILE DOES NOT EXIST - CREATE IT
         CI,R1    X'2E'
         BE       OSG5+1            FILE ALREADY OPEN - CLOSE IT
         M:TYPE   (MESS,AT24)
         B        LSTAR
OSG5     M:OPEN   F:3,(FILE,'SSNAPSHOT',':STATS'),(OUT),;
                  (KEYED),(DIRECT),(SAVE)
         M:CLOSE  F:3,(SAVE)
         B        USNAPG2
         PAGE
WSNAP    MTW,0    SNAPF             TEST SNAPSHOT FILE FLAG
         BEZ      *RETURN
         STW,RETURN  LINK           SAVE RETURN
         M:WRITE  F:2,(BUF,SNAPSUM),(SIZE,STOTB)
*        COMPUTE NEW KEY BASED UPON INTENSITY,USERS,TIME,DATE
*        FORMAT (I2,I3,A10)
         LI,R     0
         STW,R    VBUFCNT
         LI,R1    2
         LW,R2    SNAPSUM2+9        CPU INTENSITY
         DH,R2    HTTHO             SCALE TO INTEGER/200
         CI,R2    99                MAP LARGE INTENSITY TO END
         BL       %+2
         LI,R2    99                SET TO LARGEST VALUE POSSIBLE
         BAL,RETURN  SBINOUT
*
         LI,R1    3
         LW,R2    SNAPSUM2+2        # OF LOGGED USERS
         AI,R2    5                 ROUND
         DH,R2    HTEN              SCALE TO  INTEGER
         BAL,RETURN  SBINOUT
*
         LI,R     16
         STB,R    SNTIME            RESTORE BYTE COUNT
*        SOURCE --> DESTINATION
         BYTRAN   5,BA(BUFFER),(BA(NKEY)+1)
         BYTRAD   5,BA(SNTIME)+1
         BYTRAD   3,BA(SNTIME)+7
         BYTRAD   2,BA(SNTIME)+11   END OF 15 CHAR KEY
         LW,R     BLANK
         STW,R    BUFFER
         LI,R     1
         STW,R    VBUFCNT
         M:WRITE  F:3,(SIZE,STOTB),(KEY,NKEY),;
                      (NEWKEY),(WAIT)
*        'RECORD # ',I3,', ',A16
         LI,R1    AT11
         BAL,RETURN  SOUTA
         LI,R1    3
         LW,R2    ICOUNT
         BAL,RETURN  SBINOUT
         LI,R1    AT12
         BAL,RETURN  SOUTA
         LI,R1    CTIME
         BAL,RETURN  SOUTA
         ATYPE
         B        *LINK
         PAGE
CSNAP    MTW,0    SNAPF
         BEZ      *RETURN
         M:CLOSE  F:2,(SAVE)        CLOSE SNAPSHOT FILES
         M:CLOSE  F:3,(SAVE)
         LB,R1    J:JIT             GET BYTE(0) OF USER'S JIT
         CI,R1    X'40'             IS THIS A GHOST JOB
         BAZ      %+2                    NO-SKIP OC MESSAGE
         M:TYPE   (MESS,AT22)
         TYPE     ' SNAPSHOT FILES COMPLETED'
         B        *RETURN
         PAGE
*        WAIT FOR REMAINDER OF SNAPSHOT
*        UPDATES VTIME2 WITH CURRENT CLOCK TIME
*        LINK = RETURN
*        USES R,R1,ERETURN
*
LWAIT    EQU      %                 WAIT FOR REMAINDER OF INTERVAL
         LW,R1    VTIME2            LOAD LAST TIME STIME CALLED.
         BNEZ     %+4
         BAL,ERETURN  STIME
         STW,R1   VTIME2
         B        *RETURN
         BAL,ERETURN  STIME
         SW,R1    VTIME2            DETERMINE ELAPSED TIME
         CW,R1    VINT              IF ELAPSED TIME>INTERVAL
         BLE      LWAIT1
         TYPE     'CANNOT MAINTAIN INTERVAL'
         BAL,ERETURN  STIME
         STW,R1   VTIME2
         B        *RETURN
LWAIT1   EQU      %
         TYPE     '..SLEEPING'
         LW,R     VINT              GET REQUESTED INTERVAL
         SW,R     R1                SUBTRACT USED TIME
         SLD,R    -32               SET UP FOR DIVIDE
         MW,R     =5                CONVERT TO
         DW,R     =6                1.2 SECOND CLOCK
         CI,R     3
         BLE      %+2               ROUND
         AI,R1    1
         M:WAIT   *R1
         BAL,ERETURN  STIME
         STW,R1   VTIME2            RESULT AFTER WAIT
         B        *RETURN
         PAGE
LMAP     EQU      %                 SUBROUTINE TO MAP MONITOR PAGES
         LI,R1    0
         STW,R1   ISKPF             RESET SKIP FLAG
         MTW,0    IMAPF             ALREADY MAPPED
         BNEZ     *ERETURN               YES - RETURN
         MTW,0    ISKPF             IS MONITOR TO BE MAPPED
         BNEZ     %+5                    NO - SKIP PRIVILEGE CHECK
         LI,R1    JB:PRIV           CHECK PRIVILEGE LEVEL
         LB,R1    0,R1              BYTE FROM JIT
         CI,R1    X'80'             IS PRIVILEGE = 80
         BL       IMAP80                 NO - TYPE MSG & EXIT
         LI,R1    NOMAXS            TABLE SIZE
         LI,R2    0                 INITIALIZATION FOR SELECTIVE LOAD
         LI,R3    X'1FE00'          WORD ADDRESS MASK
         CW,R2    MAXPAGE,R1        FIND LARGEST TABLE ENTRY & SAVE
         BGE      %+2
         LW,R2    MAXPAGE,R1
         BDR,R1   %-3
         STS,R2   MAXPAGE
         CS,R2    =BSIZE-512        IS BUFFER LARGE ENOUGH
         BLE      IMAPA                  YES - PROCEED
         TYPE     'BUFFER TOO SMALL - REASSEMBLE'
         B        LEXIT
*        GET MONITOR PAGES AND BUFFER PAGES
IMAPA    LI,R1    512               PAGE SIZE
SADCAL   EQU      %                 MAP ONE MONITOR PAGE
         MTW,0    ISKPF             SKIP MONITOR MAP
         BNEZ     IMAPB                  YES - SKIP CAL1,8
         CAL1,8   SAD               MAP ONE MONITOR PAGE
         BCR,8    IMAPB             NORMAL RETURN
IMAP80   TYPE     'SORRY, MONITOR ACCESS REQUIRES PRIV = 80'
         B        LEXIT
IMAPB    EQU      %                 GET ONE VIRTUAL PAGE
         MTW,0    IVIRF             SKIP VIRTUAL GET PAGE
         BNEZ     SADCAL1                YES - SKIP CAL1,8
         CAL1,8   GVP               GET ONE VIRTUAL PAGE
         BCR,8    SADCAL1           NORMAL RETURN FROM CAL
         TYPE     'VIRTUAL PAGE NOT ALLOCATED, RE-ASSEMBLE'
         B        LEXIT
SADCAL1  AWM,R1   SAD               BUMP CORE PAGE ADDRESS IN FPT
         AWM,R1   SAD+1             BUMP VIRTUAL PAGE ADDRESS IN FPT
         AWM,R1   GVP               BUMP VIRTUAL PAGE ADDRESS IN FPT
         CS,R2    SAD               MAPPING COMPLETE
         BG       SADCAL            LOOP THROUGH MORE PAGES
         BL       LMAPN             END OF MAPPING.
         LI,R2    J:JIT             STORE MONITOR JIT ADDRESS IN FPT
         STS,R2   SAD               MAP MONIOR JIT LAST
         B        SADCAL            LAST TIME THROUGH LOOP
LMAPN    EQU      %
         LI,R1    1
         MTW,0    ISKPF             SKIP MONITOR MAP
         BNEZ     %+2                    YES
         STW,R1   IMAPF             SET MONITOR MAP IF NOT SKIPPED
         STW,R1   IVIRF             SET VIRTUAL PAGE FLAG
         B        *ERETURN          NORMAL RETURN
         PAGE
GDAT     EQU      %                 MONITOR DATA -->BUFFER
         STW,RETURN  LINK
         BAL,ERETURN  LMAP          MAP MONITOR PAGES
         M:TIME   TIME,TMS
         STW,R8   TIME1
         STW,R9   TIME2
         STW,R10  TIME3
         LB,R1    TIME2             COMPUTE BINARY HOURS:MIN
         MI,R1    100
         LH,R2    TIME2
         AND,R2   =X'000000FF'
         AW,R1    R2
         STW,R1   VHRMN
         BYTRAN   17,4*CTIME,BA(DTIME)     SAVE OLD TIME/DATE
GDATA    EQU      %                 BUFFER TRANSFER LOOP
         BAL,ERETURN  STIMES
         LCW,R4   R1
         LW,R1    MAXPAGE
         AI,R1    512
         SAS,R1   2                 CONVERT TO BYTES
         LI,R     0                 SET UP FOR DOUBLE PRECISION
         DW,R     =255              FIND # OF 255 BYTE GROUPS
         LI,R5    X'FF'             BYTE COUNT OF 255
         LI,R2    4*G               BA(SOURCE) - MONITOR PAGES
         LI,R3    4*F               BA(DESTINATION) - BUFFER
         STB,R5   R3                SET BYTE COUNT IN R3
         MBS,R2   0                 MOVE 255 BYTES
         BDR,R1   %-2
         STB,R    R3                STORE REMAINDER FROM DIVIDE
         MBS,R2   0                 MOVE REMAINING BYTES
         BAL,ERETURN  STIMES        GET TIME IN MILLISECONDS
         AW,R4    R1
         CI,R4    100               DID TRANSFER TAKE 100 MSEC
         BG       GDATA
         BYTRAN   17,BA(TIME)-1,4*CTIME     SET NEW TIME DATE
         PAGE
         B        *LINK
         PAGE
*        SUBROUTINE LGET1
*        PROCESSES BUFFERED MONITOR DATA INTO SMALLER AREAS
*        RETURN STORED IN LOCATION 'LINK'.
LGET1    EQU      %
         STW,RETURN  LINK           SAVE RETURN LINK
         LI,RI    #PROCS            LOCAL INDEX
INIT1    LD,R8    PROCS,RI          GET LOCAL PROCESSOR NAME
         LI,RII   PPROCS            MONITOR INDEX
         CD,R8    P:NAME+F,RII
         BE       INIT2             NAME FOUND
         BDR,RII  %-2
INIT2    AI,RII   -BGNPMPRC+1       COMPUTE DISPLACEMENT
         STW,RII  DISPS,RI
         BDR,RI   INIT1
         LI,R1    P:NAME+F-2
         AI,R1    BGNPMPRC          R1=DISPLACEMENT IN P:NAME
         AI,R1    BGNPMPRC
         LI,R4    ENDPMPRC          INDEX
INIT5    LD,R10   *R1,R4            GET TEXTC NAME FROM MONITOR
*        TRANSFER TEXT TO SIDINGS
         LB,R8    R10               SET UP BYTE COUNT FOR FLDMOV
         LW,R3    R4                COMPUTE DESTINATION DISPLACEMENT
         AI,R3    -1
         MI,R3    12                12 BYTES DISPLACEMENT
         FLDMOV   R8,R10*4,=1,BA(TS331)+1,R3
         BDR,R4   INIT5             INDEX=ENDPMPRC,...,1
         LI,R1    20
         LW,R2    BLANK
         STW,R2   SPNAME-1,R1
         BDR,R1   %-1               BLANKS INTO SNAPSHOT BUFFER
         LB,R1    TS331
         FLDMOV   R1,BA(TS331),=1,BA(SPNAME),=0
         LB,R1    TS331+3
         FLDMOV   R1,BA(TS331+3),=1,BA(SPNAME+2),=0
         LB,R1    TS331+6
         FLDMOV   R1,BA(TS331+6),=1,BA(SPNAME+4),=0
         LB,R1    TS331+9
         FLDMOV   R1,BA(TS331+9),=1,BA(SPNAME+6),=0
         LB,R1    TS331+12
         FLDMOV   R1,BA(TS331+12),=1,BA(SPNAME+8),=0
         LB,R1    TS331+15
         FLDMOV   R1,BA(TS331+15),=1,BA(SPNAME+10),=0
         LB,R1    TS331+18
         FLDMOV   R1,BA(TS331+18),=1,BA(SPNAME+12),=0
         LB,R1    TS331+21
         FLDMOV   R1,BA(TS331+21),=1,BA(SPNAME+14),=0
         LB,R1    TS331+24
         FLDMOV   R1,BA(TS331+24),=1,BA(SPNAME+16),=0
         LB,R1    TS331+27
         FLDMOV   R1,BA(TS331+27),=1,BA(SPNAME+18),=0
*        TRANSFER DATE / TIME TO SNAPSHOT BUFFER
         BYTRAN   17,4*CTIME,BA(SNTIME)     TIME/DATE-->SNAPSHOT
         LW,R1    F+X'2B'
         STW,R1   SMONDES
*        SET UP DISTRIBUTION AHEAD OF LGET5
         SNAPHIS  CH:DI2,ODI2,SDI2,1,TDI2
         PAGE
*        GET CONTROL PARAMETERS
         LI,R3    16
         LI,R8    0
         LI,R9    0
         LI,R2    0
LGET11   MTH,0    PLH:SID+F,3
         BEZ      LGET12
         LH,R1    PLH:QN+F,3
         AW,R9    R1                ACCUMULATE BATCH QUANTUM
         AI,R2    1                 INCREMENT BATCH USER COUNT
LGET12   BDR,R3   LGET11
         DW,R8    R2
         AW,R8    R8
         BEZ      LGET13
         CW,R8    R2
         BL       LGET13
         AI,R9    1
LGET13   STW,R9   ABQUAN
         LI,R5    0                 COUNT OF BATCH USERS
         LI,R6    0                 COUNT OF ONLINE USERS
         LI,R8    0
         LI,R9    0                 R8,R9 ACCUMULATE BATCH PAGES
         LI,R10   0
         LI,R11   0                 R10,R11 ACCUMULATE ONLINE PAGES
         LI,R1    SMUIS             R1=SMUIS,SMUIS-1,...,1   INDEX
LGET21   MTB,0    UB:US+F,R1
         BEZ      LGET23
         LB,R4    UB:PCT+F,R1
         LH,R2    UH:FLG+F,R1
         CI,R2    X'100'
         BAZ      LGET22
         AND,R4   =X'000000FF'      ABSOLUTE VALUE OF BYTE
         AW,R9    R4                ACCUMULATE BATCH USER PAGES
         AI,R5    1
         B        LGET23
LGET22   AW,R11   R4                ACCUMULATE ONLINE USER PAGES
         AI,R6    1
LGET23   BDR,R1   LGET21
*        DIVIDE ACCUMULATORS BY # OF USERS
LGET24   DW,R8    R5
         AW,R8    R8
         BEZ      LGET25
         CW,R8    R5
         BL       LGET25
         AI,R9    1
LGET25   STW,R9   AVBATP
         DW,R10   R6
         AW,R10   R10
         BEZ      LGET26
         CW,R10   R6
         BL       LGET26
         AI,R11   1
LGET26   STW,R11  AVONLP
         LI,RI    0
LGET1A   AI,RI    1           I=I+1.
         CI,RI    D30-1             IF I = NEXT TO LAST PARAM
         BG       LGET2                  GO TO LGET2
         LW,R4    AVAL1,RI    ANEW1(I)=VALUE OF I-TH NAME.
         LW,R4    0,R4
         STW,R4   ANEW1,RI
         B        LGET1A      GOTO LGET1A.
*GET USE VALUES
LGET2    LI,RI    0           I=0.
LGET2A   AI,RI    1           I=I+1.
         CI,RI    #SUSE             IF I>#SINGLE USE ITEMS
         BG       LGET3
         LW,R     ANEW2,RI    A0LD2(I)=ANEW2(I).
         STW,R    AOLD2,RI
         LW,R4    AVAL2,RI    ANEW2(I)=(AVAL2(I)).
         LW,R4    0,R4
         STW,R4   ANEW2,RI
         B        LGET2A      GOTO LGET2A
*GET USE GROUPS
LGET3    LI,R1    15                TABLE LENGTH
         LW,R     VCIT-1,R1
         STW,R    VOCIT-1,R1
         BDR,R1   %-2               LOOP THROUGH TEMP DATA
*
*        BUFFERED CLOCK USED TO COMPUTE TICS,SECONDS
         LI,R     0                 SET UP DOUBLE WORD
         LI,R1    30                COMPUTE CURRENT TIME IN TICS
         SW,R1    C:TINC+F
         AW,R1    C:TIC+F           ADD ACCUMULATED TICS
         STW,R1   VTIC
         AI,R1    500/2             ANTICIPATE ROUNDING
         DW,R     =500
         STW,R1   VSEC              CONVERT TO SECONDS
GEOM     EQU      %                 GET EOMTIME AND TRACK
         LI,R1    LNOL-1            INDEX = (# LINES -1)
         BLZ      GEOMND
GEOM1    LB,R2    LB:UN+F,R1        GET USER # FROM LINE TABLE
         LB,R2    UB:US+F,R2        GET USER STATE
         CI,R2    0                 IS STATE ZERO
         BNE      %+3                    NO - CONTINUE
         STW,R2   LEOM,R1           YES - ZERO LEOM
         B        GEOMN             TO NEXT COC LINE
*        AT THIS POINT THE LINE HAS A USER IN NON-ZERO STATE
         LH,R4    EOMTIME+F,R1
         CI,R2    SIR               IS A SHIFT REQUIRED
         BE       %+2                    NO - CONTINUE
         SLS,R4   5                 YES - SHIFT LEFT 5 (*32)
         LW,R5    =X'FFE00000'      SIGNIFICANT BITS MASK
         LS,R4    VTIC              MERGE SIGNIFICAT VTIC BITS
         CW,R4    VTIC              IS R4 > VTIC TICS
         BLE      %+2                    NO - CONTINUE
         SW,R4    =X'00200000'      YES - CORRECT ERROR DUE TO TRUNCATION
*        HAS HALFWORD VALUE CHANGED
         LW,R5    =X'001FFFFF'
         CS,R4    LEOM,R1
         BE       %+3
         STW,R4   LEOM,R1           SET LEOM
         B        GEOMN                  TO NEXT COC LINE
*        HALFWORD UNCHANGED
GEOMN    BDR,R1   GEOM1                   TO NEXT LINE
         CI,R1    0
         BE       GEOM1                   PICK UP LINE 0
GEOMND   EQU      %
         LI,RIII  DT                # OF ITEMS IN ALL USE GROUPS
         LW,R     ANEW3,RIII  FROM THE LAST TIME PERIOD
         STW,R    AOLD3,RIII  AS OLD VALUES.
         BDR,RIII %-2
         LI,RI    0                 INITIALIZE GROUP INDEX
         LI,RIII  1           INITIALIZE INDEX TO NEW VALUES.
LGET3A   AI,RI    1           INCREMENT INDEX TO GROUPS.
         STW,RIII ASAVE3,RI   SAVE INDEX TO START OF SAVES FOR GROUP.
         CI,RI    #GRP              IF NO MORE GROUPS
         BG       LGET5         GO TO LGET5.
         LW,R     ASUMN3,RI   SAVE NEW SUM FROM LAST TIME
         STW,R    ASUMO3,RI     AS OLD SUM FOR THIS TIME.
         LW,RI6   AGET3,RI    INITITIZE INDEX TO GETS FOR THIS GROUP.
         LI,R9    0
         STW,R9   TOTAL
         STW,R9   VDISP
LGET3B   LW,RII   0,RI6
         LW,R10   RII
         AND,RII  =X'FF000000'
         SLS,RII  -24
         AND,R10  =X'FFFFFF'
         B        %,RII
         B        L3PLUS      FOR INTERPRETING COMMAND.
         B        L3PLUSBY
         B        L3MINUS
         B        L3TIMES
         B        L3DIVID
         B        L3SUM
         B        L3DISP
         B        L3ADDTO
         B        L3SAVES
         B        L3NEXT
         B        L3DONE
         B        L3IDISP
         B        L3SAVEZ
         B        L3FLAG
         B        L3DISP
         B        L3SMQ
         B        LSIZE
         B        LSUMBTBL
         B        LTABLE
         B        LSUMDISP
         B        LOGMIN
         B        LSTATQ
*                                       OP IS VALUE PTED TO BY OPERAND.
L3PLUS   CI,R10   0                 IF ZERO
         BE       L3LOOP            PREF IN MONSTK ASSUMED
         LW,R1    R10               X=X+OP(DISP)
         AW,R1    VDISP
         AW,R9    0,R1
         B        L3LOOP      GO GET NEXT INSTRUCTION.
*
L3PLUSBY LW,R1    R10         X=X+BYTE OP(DISP).
         SLS,R1   2
         AW,R1    VDISP
         LB,R     0,R1
         AW,R9    R
         B        L3LOOP      GO GET NEXT INSTRUCTION.
*
L3MINUS  LW,R1    R10         X=X-OP.
         SW,R9    0,R1
         B        L3LOOP      GO GET NEXT INSTRUCTION.
*
L3TIMES  LW,R1    R10         X=X*OP.
         MW,R8    0,R1
         B        L3LOOP      GO GET NEXT INSTRUCTION.
*
L3DIVID  LW,R1    R10         X=X/OP ROUNDED.
         LI,R8    0
         CW,R8    *R1
         BEZ      L3LOOP
         DW,R8    0,R1
         SLS,R8   1
         CW,R8    *R1
         BL       L3LOOP
         AI,R9    1
         B        L3LOOP      GO GET NEXT INSTRUCTION.
*
L3SUM    LW,R1    R10         X=SUM OF 14 1/2 WORDS AT OP+2.
         SLS,R1   1
         LW,R2    VDISP
         SLS,R2   4
         AI,R2    2
         AW,R1    R2
         LI,R2    14
         LH,R10   0,R1              RETREIVE HALFWORD COUNT
         AND,R10  =X'0000FFFF'      TREAT AS POS INTEGER 0-->FFFF
         AW,R9    R10               ACCUMULATE TOTAL COUNT IN TABLE
         AI,R1    1
         BDR,R2   %-4
         B        L3LOOP      GO GET NEXT INSTRUCTION.
*
L3SMQ    EQU      %
         LI,R9    0                 COUNT OF USER PROGRAMS
         LI,R1    SMUIS
LSUMQ1   EQU      %
         MTB,0    UB:US+F,R1
         BEZ      LSUMQ2            NO USER IN THIS SLOT
         LH,R4    UH:FLG+F,R1
         CI,R4    X'4C0'            DELTA, TEL OR CCI
         BANZ     LSUMQ2
         MTB,0    UB:APR+F,R1       PROCESSOR
         BNEZ     LSUMQ2
         MTB,0    UB:ASP+F,R1       SPECIAL PROCESSOR
         BNEZ     LSUMQ2
         MTB,0    UB:DB+F,R1        DEBUGGER
         BNEZ     LSUMQ2
         AI,R9    1
LSUMQ2   EQU      %
         BDR,R1   LSUMQ1
         B        L3LOOP
*
L3DISP   LW,R10   *R10
         CI,RII   DISP0
         BNE      %+2
         AI,R10   BGNPMPRC-1
*
L3IDISP  STW,R10  VDISP
         B        L3LOOP
L3ADDTO  LW,R1    R10         OP=OP+X.
         AWM,R9   0,R1
         B        L3LOOP      GO GET NEXT INSTRUCTION.
*
L3SAVES  STW,R9   ASUMN3,RI   NEW SUM FOR GROUP=X.
         B        L3LOOP      GO GET NEXT INSTRUCTION
*
L3SAVEZ  LW,R1    R10
         STW,R9   *R1
         LI,R9    0
         B        L3LOOP
*
L3FLAG   EQU      %
         LI,R1    SMUIS
         CH,R10   UH:FLG+F,R1
         BAZ      %+2
         AI,R9    1
         BDR,R1   %-3
         B        L3LOOP
*
L3NEXT   STW,R9   ANEW3,RIII  SAVE X AS NEXT NEW VALUE.
         CW,R9    =X'00FFFFFF'
         BLE      %+2               OVERFLOW TEST
         B        %+1
         CI,R9  0
         BGE      %+2               NEGATIVE TEST
         B        %+1
         AI,RIII  1           INCREMENT INDEX TO NEW VALUES.
         LI,R9    0           DISP=0.
         STW,R9   VDISP
         B        L3LOOP      GO GET NEXT INSTRUCTION
*
L3DONE   B        LGET3A      GO TO SETTING UP FOR NEXT GROUP.
*
L3LOOP   AI,RI6   1           INCREMENT INDEX TO INSTRUCTIONS.
         B        LGET3B      GO TO LGET3B TO SET UP INSTRUCTION.
*
LSIZE    LW,R1    R10
         B        L3LOOP
LSUMBTBL EQU      %
         CW,R10   =F
         BE       L3LOOP
         LB,R2    *R10,R1
         BEZ      %+2
         AI,R9    1
         BDR,R1   %-3
         B        L3LOOP
LTABLE   EQU      %
         LW,R2    R10
         B        L3LOOP
LSUMDISP EQU      %
         LI,R1    SMUIS
         LW,R10   *R10
         AI,R10   BGNPMPRC-1
         MTB,0    UB:US+F,R1
         BEZ      %+4
         CB,R10   *R2,R1
         BNE      %+2
         AI,R9    1
         BDR,R1   %-5
         B        L3LOOP
* IF R10=0;
*        ACCUMULATE USER-MINUTES NOT YET IN C:SIT BY REFERENCING
*        EOMTIME HALFWORD TABLE FOR EACH USER NOT IN STATE ZERO AND
*        NOT USING LOGON PROCESSOR.
LOGMIN   EQU      %
         LI,R10   0                 0 MEANS COMPUTE LOGGED MINUTES
         LW,R2    DLOGON            LOAD LOGON PROC POSITION IN PNAME
         AI,R2    BGNPMPRC-1        ADD BIAS
         LI,R1    SMUIS             INDEX FOR # ONLINE USERS
*        SEARCH FOR USER ON LINE AND NOT IN LOGON PROCESSOR
LOGMIN1  LB,R7    UB:US+F,R1
         BEZ      LOGMIN4           SKIP IF USER NOT ON-LINE, STATE ZERO
         CI,R10   0                 ARE WE COMPUTING LOGGED-MINUTES
         BE       LOGMIN0                YES - SKIP TERMINAL INPUT STATE TESTS
         CI,R7    STI               NO - CONSIDER EOMTIME IF STI OR STIO
         BE       LOGMIN0           TERMINAL INPUT - IN CORE
         CI,R7    STIO
         BNE      LOGMIN4           NOT INPUT STATE - SKIP
*        EITHER COMPUTING LOGGED-MIN
*                 OR
*        COMPUTING THINK-TYPE MIN AND IN INPUT BOUND STATES
LOGMIN0  EQU      %                 CONTINUE TO TEST FOR INPUT REQUEST STATE
*                                   AND FOR LOGON ASSOCIATED PROCESSOR
         CI,R7    SIR
         BE       LOGMIN4           EOMTIME NOT VALID IN THIS STATE
         CB,R2    UB:ASP+F,R1
         BE       LOGMIN4         SKIP IF USER IN LOGON
*        SEARCH COC TABLE FOR THIS USER
         LI,R7    LNOL-1
LOGMIN2  LB,R11   LB:UN+F,R7
         CW,R11   R1                FIND USERS LINE #
         BNE      LOGMIN3
         LW,R11   VTIC
         SW,R11   LEOM,R7           CORRENT-LEOM=ELAPSED TIME
         BLEZ     LOGMIN4         IGNORE ZERO OR NEG DIFFERENCE
         AW,R9    R11
         B        LOGMIN4           SKIP REST OF LINE SEARCH
LOGMIN3  BDR,R7   LOGMIN2
         CI,R7    0
         BE       LOGMIN2           PICK UP LINE 0.
LOGMIN4  BDR,R1   LOGMIN1
         CI,R10   0                 IF COMPUTING LOGGED MIN
         BE       %+3                    SKIP THINK-TYPE ERROR
         AW,R9    CTYER             ADD THINK-TYPE ERROR
         B        %+2
         AW,R9    CITER             ADD INTERACTION ERROR
         B        L3LOOP
LSTATQ   LW,R1    R10
         LB,R2    SB:HQ+F,R1
         BEZ      L3LOOP            QUEUE IS EMPTY
         AI,R9    1
         LB,R2    UB:FL+F,R2
         BEZ      L3LOOP
         B        %-3
         PAGE                       GET VALUES FOR BIG DISTRIBUTIONS
LGET5    SNAPHIS  CH:DI1,ODI1,SDI1,1,TDI1
*                 CH:DI2,ODI2,SDI2,1,TDI2 SET UP IN LGET1
         SNAPHIS  CH:DI3,ODI3,SDI3,1,TDI3
         SNAPHIS  CH:DOT,ODOT,SDOT,1,TDOT
         SNAPHIS  CH:DOS,ODOS,SDOS,1,TDOS
         SNAPHIS  CH:DRT,ODRT,SDRT,1,TDRT
         SNAPHIS  CH:DIT,ODIT,SDIT,1,TDIT
         SNAPHIS  CH:DTT,ODTT,SDTT,#HIS,TDTT
         SNAPHIS  CH:DT,ODT,SDT,#HIS,TDT
         SNAPHIS  CH:DC,ODC,SDC,#HIS,TDC
         SNAPHIS  CH:DLI,ODLI,SDLI,#HIS,TDLI
         SNAPHIS  CH:DLO,ODLO,SDLO,#HIS,TDLO
         BYTRAN   32,BA(SDI1),BA(SDIST)  SYSTEM DISTRIB-->SNAPSHOTBUFFER
         BYTRAD   32,BA(SDI2)
         BYTRAD   32,BA(SDI3)
         BYTRAD   32,BA(SDOT)
         BYTRAD   32,BA(SDOS)
         BYTRAD   32,BA(SDRT)
         BYTRAD   32,BA(SDIT)
         BYTRAD   32,BA(SDTT)
         BYTRAD   32,BA(SDT)
         BYTRAD   32,BA(SDC)
         BYTRAD   32,BA(SDLI)
         BYTRAD   32,BA(SDLO)
         TSUM     C:COS,OCOS,DCOS,1
         TSUM     C:SRT,OSRT,DSRT,1
         TSUM     C:SIT,OSIT,DSIT,1
         TSUM     C:STT,OSTT,DSTT,#HIS
         TSUM     C:ST,OST,DST,#HIS
         TSUM     C:SC,OSC,DSC,#HIS
         TSUM     C:CI,OCI,DCI,#HIS
         TSUM     C:CO,OCO,DCO,#HIS
         B        *LINK             RETURN
         PAGE                       REPORT WRITER
*OUTPUT CONTROL PARAMETERS
LOUT1    EQU      %                 PRINT ONE REPORT
         STW,RETURN  LINK           SAVE RETURN LINK
*        TEST FOR UNEXPECTED RESET IN C:TIC DUE TO RESET OR FAULT
         LW,R1    FCEXC             TIME TEST NOT NEC IF FCEXC SET
         BNEZ     LOUT1AA
         LW,R1    VOTIC             IS TIME INCREASING
         CW,R1    VTIC
         BL       LOUT1AA                YES
         TYPE     'UNEXPECTED CHANGE IN TIME - REPORT SKIPPED'
         B        *LINK             RETURN
LOUT1AA  EQU      %
         LI,RI    0                 I=0
         LI,R10   1           EVEN=1.
         LW,R     FCEXC
         AW,R     APRIN1
         BEZ      LOUT1A
         PRINT    TH30
LOUT1A   AI,RI    1           I=I+1.
         CI,RI    D30
         BG       LOUT1Z
         LW,R1    ATEXT1,RI         OUTPUT TEXT FOR I-TH ITEM
         LW,R     FCEXC
         AW,R     APRIN1
         BEZ      %+2
         BAL,RETURN   SOUTA
         LI,R8    0           N=ANEW1(I)/ASCAL1(I).
         LW,R9    ANEW1,RI
         LW,R     ASCAL1,RI
         BNEZ     LOUT11
         SLS,R9   1
         B        LOUT13
LOUT11   CI,R     C'A'
         BNE      LOUT12
         LI,R1    6YES
         CI,R9    0
         BNEZ     %+2
         LI,R1    6NO
         STW,R2   SCONT,RI
         LW,R     FCEXC
         AW,R     APRIN1
         BEZ      %+2
         BAL,RETURN  SOUTA
         B        LOUT14
LOUT12   DW,R8    ASCAL1,RI
LOUT13   LI,R1    6
         LW,R2    R9
         STW,R2   SCONT,RI
         LW,R     FCEXC
         AW,R     APRIN1
         BEZ      %+2
         BAL,RETURN   SBINOUT
LOUT14   CI,R10   0
         BE       LOUT1C
         LI,R10   0           EVEN=0.
         LW,R     FCEXC
         AW,R     APRIN1
         BEZ      %+3
         LI,R1    2
         BAL,RETURN   SBLANK
         B        LOUT1A      GOTO LOUT1A.
LOUT1C   LI,R10   1           EVEN=1
         LW,R     FCEXC             ARE CONTROL PARAMETERS DESIRED
         AW,R     APRIN1            OR PRINT FLAG
         BEZ      %+2                    NO - SKIP 'SEND' AND ZERO VBUFCNT
         BAL,RETURN  SEND                YES - OUTPUT A LINE
         B        LOUT1A      GOTO LOUT1A.
LOUT1Z   LW,R     FCEXC
         AW,R     APRIN1            OR PRINT FLAG
         BEZ      %+2
         BAL,RETURN   SEND
         LB,R     COMMAND           IS COMMAND(0) = C
         CI,R     C'C'
         BNE      LOUT2
         B        *LINK             RETURN
         PAGE                       OUTPUT USE VALUES
LOUT2    LI,RI    0                 I=0
         LI,R10   1           EVEN=1.
LOUT2A   AI,RI    1           I=I+1.
         CI,RI    #SUSE             IF I>#SINGLE USE ITEMS
         BG       LOUT3
         LW,R     APRIN2,RI  IF APRIN2(RI)=0 GOLOUT2A.
         BEZ      LOUT2A
         LW,R1    ATEXT2,RI         OUTPUT TEXT FOR I-TH ITEM
         BAL,RETURN SOUTA
         LI,R8    0           N=ANEW2(RI)/ASCAL2(RI).
         LW,R9    ANEW2,RI
         LW,R     ASCAL2,RI
         BNEZ     %+3
         SLS,R9   1
         B        %+2
         DW,R8    ASCAL2,RI
         LI,R1    6           OUTPUT TEXT FOR N.
         LW,R2    R9
         BAL,RETURN   SBINOUT
LOUT2Z   BAL,RETURN  SEND
         B        LOUT2A
         PAGE                       OUTPUT USE GROUP HEADERS
*        RI       INCREMENTING GROUP INDEX
*        R11      DECREMENTING COUNT OF ROW SPACE REMAINING
LOUT3    LI,RI    0                 SET UP GROUP INDEX
LOUT3A   LW,R10   RI                SAVE INDEX TO 1ST OF CURRENT ROW
*        PRINT HEADER FOR USE GROUPS
         BAL,RETURN  SPAGE          NEW PAGE - IF NEEDED
         LI,R11   3           DO 3 TIMES.
LOUT3A1  AI,RI    1
         CI,RI    #GRP
         BG       LOUT3B
         MTW,0    APRIN3,RI
         BEZ      LOUT3A1           LOOP THROUGH HEADERS
         CI,RI    1           IF CURRENT GROUP IS SUMMARY,
         BNE      %+2
         LI,R11   2
         LW,R1    AHEAD3,RI   PUT THE HEADER FOR THE CURRENT USE GROUP
         BAL,RETURN SOUTA       IN THE OUTPUT BUFFER.
         LI,R1    2
         BAL,RETURN  SBLANK
         BDR,R11  LOUT3A1
         PAGE                       OUTPUT USE GROUP DATA
LOUT3B   BAL,RETURN  SEND
         LI,R     0
         STW,R    MDEPTH      INITIALIZE MAX DEPTH.
         STW,R    DEPTH       INITIALIZE DEPTH.
LOUT3B1  LW,RI    R10               INITIALIZE INDEX TO 1ST OF CUR ROW
         LI,R11   3           DO 3 TIMES.
LOUT3B2  AI,RI    1                 INCREMENT GROUP INDEX
         CI,RI    #GRP              IF NO MORE GROUPS--
         BG       LOUT3E1       CHECK, GOTO LOUT3E1.
         CI,RI    1                 IF CURRENT GROUP IS SUMMARY
         BNE      %+2
         LI,R11   2
         LW,R     ADEPTH3,RI  IF THE DEPTH OF THE CURRENT GROUP IS
         CW,R     MDEPTH        GREATER THAN THE MAX DEPTH,
         BLE      %+2
         STW,R    MDEPTH        SET THE MAX DEPTH EQUAL TO IT.
         CW,R     DEPTH       IF THE DEPTH OF CURRENT GROUP IS LESS THAN
         BG       LOUT3B4       THE CURRENT DEPTH,
         LW,RI6   AHEAD3,RI     GET THE LENGTH OF THE
         LB,R1    *RI6              GET HEADING LENGTH
         MTW,0    APRIN3,RI
         BEZ      LOUT3EZ
         BAL,RETURN  SBLANK         SPACE THAT MANY (R1)
         B        LOUT3EZ
LOUT3B4  MTW,0    APRIN3,RI
         BEZ      LOUT3C
         LW,RI6   ASIDE3,RI
         AW,RI6   DEPTH         FOR THE CURRENT GROUP
         LW,R1    0,RI6
         BAL,RETURN SOUTA       TO THE OUTPUT BUFFER.
LOUT3C   CI,RI    1                 IS THIS GROUP 31 SUMMARY
         PAGE     PRINT THE OVERALL STATISTICS IN 'ALL' COLUMN
         BNE      LOUT3C1                NO - SKIP TO LOUT3C1
         LW,R1    DEPTH
         EXU      ASUMRYN,R1    CURRENT DEPTH.
         STW,R    ASUMN3,RI     SAVE RESULT AS NEW SUM. (IF COME HERE.)
*        IF GROUP DIVIDE FLAG IS ON DIVIDE ANEW(RIII) BY ASUMN3(RI)
LOUT3C1  LW,RIII  ASAVE3,RI         GET RELATIVE START OF ITEMS
         AW,RIII  DEPTH         ADD DEPTH.
         LW,R9    ANEW3,RIII  GET NEXT SAVED NEW VALUE.
         LW,R     ADIV3,RI    IF DIVIDE FLAG IS ON,
         BEZ      LOUT3C2
         LI,R8    0             DIVIDE NEW VALUE BY
         MTW,0    ASUMN3,RI
         BEZ      LOUT3C2
         MW,R8    ASCAL3,RI         SCALE BY GROUP MULTPLIERS
         DW,R8    ASUMN3,RI       DIVIDE BY GROUP DIVISOR
         AW,R8    R8
         BEZ      LOUT3C2
         CW,R8    ASUMN3,RI     AND
         BL       LOUT3C2       ROUND RESULT.
         AI,R9    1
LOUT3C2  LW,R1    ALENG3,RI   GET LENGTH OF NUMBERS FOR CURRENT GROUP.
         LW,R2    R9          PUT THE NUMBER
         STW,R2   SNAPSUM2,RIII     OVERALL STATS-->SNAPSHOT BUFFER
         MTW,0    APRIN3,RI
         BEZ      LOUT3D
         BAL,RETURN SBINOUT     IN THE BUFFER.
         LW,R     ADEC3,RI    IF THE CURRENT GROUP CALLS FOR DECIMAL PT,
         BEZ      %+2
         BAL,RETURN  SPD            INSERT PERIOD BEFORE LAST CHAR
         B        LOUT3D
LOUT3C3  LI,R1    8                 # BLANKS TO SKIP COL
         MTW,0    APRIN3,RI
         BEZ      %+2
         BAL,RETURN SBLANK
LOUT3D   LW,R     ASAM3,RI    IF THE GROUP DOES NOT CALL FOR SAMPLE ALSO
         PAGE
*        OUTPUT THE SNAPSHOT SAMPLE STATISTIC
         BEZ      LOUT3EZ       GO TO LOUT3EZ.
         CI,RI    1                 IS THIS GROUP 31 SUMMARY
         BNE      LOUT3D1                NO - SKIP TO LOUT3D1
         LW,R1    DEPTH         CURRENT DEPTH.
         EXU      ASUMRYO,R1
         STW,R    ASUMO3,RI     SAVE RESULT AS OLD SUM. (IF COME HERE.)
LOUT3D1  LW,R9    ANEW3,RIII        SAMPLE = ANEW3-AOLD3
         SW,R9    AOLD3,RIII
         LW,R     ADIV3,RI    IF DIVIDE FLAG IS ON,
         BEZ      LOUT3D2
         LW,R12   ASUMN3,RI
         SW,R12   ASUMO3,RI
         BEZ      LOUT3D2
         LI,R8    0             DIVIDE OLD VALUE
         MW,R8    ASCAL3,RI         SCALE BY GROUP MULTIPLIERS
         DW,R8    R12               DIVIDE BY GROUP DIVISOR
         AW,R8    R8
         CW,R8    R12
         BL       LOUT3D2       ROUND RESULT.
         AI,R9    1
LOUT3D2  LW,R1    ALENG3,RI   GET LENGTH OF NUMBER FOR CURRENT GROUP.
         LW,R2    R9          APPEND THE NUMBER
         STW,R2   SNAPSUM2,RIII     STORE SAMPLE STATS IN SNAPSHOT BUFFER
         MTW,0    APRIN3,RI
         BEZ      LOUT3EZ
         BAL,RETURN SBINOUT     TO THE BUFFER.
         LW,R     ADEC3,RI    IF THE CURRENT GROUP CALLS FOR DECIMAL PT.
         BEZ      %+2
         BAL,RETURN  SPD            INSERT PERIOD BEFORE LAST CHAR
         PAGE
*        RI       INCREMENTING GROUP INDEX
*        R11      DECREMENTING COUNT OFSPACE REMAINING
*        END OF GROUP, END OF LINE TEST FOR PRINT LOOP
LOUT3EZ  MTW,0    APRIN3,RI
         BEZ      %+4
         LI,R1    2
         BAL,RETURN  SBLANK
         AI,R11   -1                DECREMENT IF GROUP IS PRINTED
         AI,RIII  1                 INCREMENT ITEM INDEX
         CI,R11   0                 ARE PRINT AREAS FILLED
         BG       LOUT3B2
LOUT3E1  BAL,RETURN  SEND           OUTPUT A LINE IF NONEMPTY
         LW,R     DEPTH       INCREMENT DEPTH.
         AI,R     1
         STW,R    DEPTH
         CW,R     MDEPTH      IF MAX DEPTH HAS NOT BEEN REACHED
         BL       LOUT3B1                TRY ONE MORE LINE
         CI,RI    #GRP
         BG       LOUT4
         B        LOUT3A
         PAGE                       INSTRUCTION FOR EXU INDEXED
*        DIVISORS FOR SUMMARY GROUP - OVERALL STATISTICS, COL 1
ASUMRYN  B        LOUT3C3           1  - # BATCH STREAMS
         B        LOUT3C3           2  - # LOGGED USERS
         B        LOUT3C3           3  - % CPU/BATCH USER
         B        LOUT3C3           4  - % CPU/ONLINE USER
         LW,R     VBSR              5  - BATCH EXECUTION/SERVICE
         LW,R     VLSR              6  - ONLINE EXECUTION/SERVICE
         LW,R     VRTRW             7  - CPU MSEC PER I/O
         LW,R     VSCI              8  - ONLINE TIME MIX
         LW,R     VTYP              9  - ONLINE INTENSITY
         LW,R     VSIT              10 - TASKS/MIN
         LW,R     VCIT              11 - % INTERACTIVE
         B        LOUT3C3           12 - 90 % RESPONSE
         LW,R     VCIT              13 - TASK TURNAROUND
         B        LOUT3C3           14 - ETMF
*                                   INSTRUCTIONS FOR EXU INDEXED
*        DIVISORS FOR SUMMARY GROUP - SNAP COL
ASUMRYO  B        LOUT3O            1
         B        LOUT3O            2
         B        LOUT3O            3
         B        LOUT3O            4
         LW,R     VOBSR             5
         LW,R     VOLSR             6
         LW,R     VORTRW            7
         LW,R     VOSCI             8
         LW,R     VOTYP             9
         LW,R     VOSIT             10
         LW,R     VOCIT             11
         B        LOUT3O            12
         LW,R     VOCIT             13
         B        LOUT3O            14
         PAGE
LOUT3O   LW,RIII  ASAVE3,RI
         AW,RIII  DEPTH
         LW,R9    ANEW3,RIII
         B        LOUT3D2
LOUT3O1  LW,R9    VUAVE             LOAD AVER # LOGGED USERS
         B        LOUT3D2
         PAGE
LOUT4    MTW,0    APRIN4+1
         BEZ      LOUT4A
         BAL,RETURN  SPAGE
         LI,RIII  12                12 ITEMS
LOUT4H1  LI,RI    4
LOUT4H2  LW,R1    AHEAD4,RIII
         BAL,RETURN  SOUTA
         AI,RIII  -1
         BDR,RI   LOUT4H2
         BAL,RETURN  SEND
         CI,RIII  0
         BG       LOUT4H1
         PAGE
*        SYSTEM PERCENTAGES
LOUT4P   LI,RIII  2                 ROW INDEX = 2,3,4,...,15
LOUT4P1  LI,RII   7                 COLUMN INDEX
         LI,R1    TD1D              LOG SIDING
         AW,R1    RIII
         AW,R1    RIII
         BAL,RETURN  SOUTA
         PERCENT  ADIST4,ATOT4,5
         LI,R1    TD4A
         AW,R1    RIII
         AW,R1    RIII
         BAL,RETURN  SOUTA
         PERCENT  ADIST4,ATOT4,2
         BAL,RETURN  SEND           PRINT ONE ROW
         AI,RIII  1                 INCREMENT ROW INDEX
         CI,RIII  16
         BL       LOUT4P1
         PAGE
*        SYSTEM DISTRIBUTION TOTALS
LOUT4T   LI,R1    TOT4              SIDING
         BAL,RETURN  SOUTA
         LI,RIII  7                 # OF ITEMS
         LI,RII   5                 # OF COLUMNS
LOUT4T1  LI,R1    5                 # OF DIGITS
         LW,R2    ATOT4,RIII
         LW,R2    *R2
         BAL,RETURN  SBINOUT
         AI,RIII  -1
         BDR,RII  LOUT4T1
         LI,R1    TOT4
         BAL,RETURN  SOUTA
         LI,RII   2
LOUT4T2  LI,R1    5                 # OF DIGITS
         LW,R2    ATOT4,RIII
         LW,R2    *R2
         BAL,RETURN  SBINOUT
         AI,RIII  -1
         BDR,RII  LOUT4T2
         BAL,RETURN  SEND
         PAGE
LOUT4A   MTW,0    APRIN4+2          PROC DISTRIB
         BEZ      LOUT5
         BAL,RETURN  SPAGE
         LI,RIII  12                ITEMS IN HEADING
LOUT4HA1 LI,RI    4                 ITEMS PER LINE
LOUT4HA2 LW,R1    AHEAD4A,RIII
         BAL,RETURN  SOUTA
         AI,RIII  -1
         BDR,RI   LOUT4HA2
         BAL,RETURN  SEND
         CI,RIII  0
         BG       LOUT4HA1
*        <<<<<<<<<<<  FILL IN LATER  >>>>>>>>>>>>>>
         PAGE
*        PROCESSOR PERCENTAGES
LOUT4PA  LI,RIII  2                 ROW INDEX = 2,3,4,...,15
LOUT4PA1 LI,RII   5                 COLUMN INDEX
         LI,R1    TD1D              LOG SIDING
         AW,R1    RIII
         AW,R1    RIII
         BAL,RETURN  SOUTA
         PERCENT ADIST4A,ATOT4A,3
         LI,R1    TD4A
         AW,R1    RIII
         AW,R1    RIII
         BAL,RETURN  SOUTA
         PERCENT  ADIST4A,ATOT4A,2
         BAL,RETURN  SEND           PRINT ONE ROW
         AI,RIII  1                 INCREMENT ROW INDEX
         CI,RIII  16
         BL       LOUT4PA1
         PAGE
LOUT4TA  LI,R1    TOT4
         BAL,RETURN  SOUTA
         LI,RIII  5                 # OF COLUMNS
         LI,RII   3                 COLUMNS PER GROUP
LOUT4T1A LI,R1    5                 # OF DIGITS
         LW,R2    ATOT4A,RIII
         LW,R2    *R2
         BAL,RETURN  SBINOUT
         AI,RIII  -1
         BDR,RII  LOUT4T1A
         LI,R1    TOT4              SIDING
         BAL,RETURN  SOUTA
         LI,RII   2                 COLUMNS PER GROUP
LOUT4T2A LI,R1    5                 # OF DIGITS
         LW,R2    ATOT4A,RIII
         LW,R2    *R2
         BAL,RETURN  SBINOUT
         AI,RIII  -1
         BDR,RII  LOUT4T2A
         BAL,RETURN  SEND
         PAGE
LOUT5    MTW,0    APRIN5+1
         BEZ      *LINK
         BAL,RETURN  SPAGE
         LI,RIII  12                3 LINES, 4 ITEMS PER LINE
LOUT5H   LW,R1    AHEAD5,RIII
         BAL,RETURN  SOUTA
         AI,RIII  -1
         LW,R1    AHEAD5,RIII
         BAL,RETURN  SOUTA
         AI,RIII  -1
         LW,R1    AHEAD5,RIII
         BAL,RETURN  SOUTA
         AI,RIII  -1
         LW,R1    AHEAD5,RIII
         BAL,RETURN  SOUTA
         AI,RIII  -1
LOUT5H2  BAL,RETURN  SEND
         CI,RIII  0
         BG       LOUT5H
         PAGE
*        SWAP DISTRIBUTIONS
LOUT5P   LI,RIII  2                 ROW INDEX = 2,3,4,...,15
LOUT5P1  LI,RII   5                 # OF COLUMNS
         LI,R1    TD5C
         AW,R1    RIII
         AW,R1    RIII
         BAL,RETURN  SOUTA
         PERCENT  ADIST5,ATOT5,1
         LI,R1    TD1D
         AW,R1    RIII
         AW,R1    RIII
         BAL,RETURN  SOUTA
         PERCENT  ADIST5,ATOT5,1
         LI,R1    TD1D
         AW,R1    RIII
         AW,R1    RIII
         BAL,RETURN  SOUTA
         PERCENT  ADIST5,ATOT5,3
         BAL,RETURN  SEND           PRINT ROW
         AI,RIII  1                 INCREMENT ROW INDEX
         CI,RIII  16
         BL       LOUT5P1
         PAGE
*        SWAP DISTRIBUTION TOTAL
LOUT5T   LI,R1    TOT4              SIDING
         BAL,RETURN  SOUTA
         LI,R1    5                 # OF DIGITS
         LW,R2    *ATOT5+5          VALUE
         BAL,RETURN  SBINOUT
         LI,R1    TOT4              SIDING
         BAL,RETURN  SOUTA
         LI,R1    5                 VALUE
         LW,R2    *ATOT5+4
         BAL,RETURN SBINOUT
         LI,R1    TOT4
         BAL,RETURN  SOUTA
         LI,R1    5                 # OF DIGITS
         LW,R2    *ATOT5+3
         BAL,RETURN  SBINOUT
         LI,R1    5                 # OF DIGITS
         LW,R2    *ATOT5+2
         BAL,RETURN  SBINOUT
         LI,R1    5                 # OF DIGITS
         LW,R2    *ATOT5+1
         BAL,RETURN  SBINOUT
         BAL,RETURN  SEND
         B        *LINK             RETURN
         PAGE                       INITIALIZATION AND COMMAND LOOP
INIT     EQU      %
         M:TRAP   (IGNORE,FX)       IGNORE FIXED POINT OVERFLOWS
*
         LB,R1    J:JIT             GET BYTE(0) OF USERS JIT
         CI,R1    X'40'             IS THIS A GHOST JOB.
         BAZ      INIT3A                 NO - CONTINUE
         M:OPEN   M:SI,(FILE,'GHOSTSI'),(ERR,INITSI),(ABN,INITSI)
         M:OPEN   M:DO,(FILE,'GHOSTDO',':STATS'),(IN),; IS FILE THERE
                  (ERR,INITDO1),(ABN,INITDO1),(SAVE)
         M:CLOSE  M:DO,(SAVE)
INIT1A   M:OPEN   M:DO,(FILE,'GHOSTDO',':STATS'),(INOUT),; UPDATE
                  (ERR,INITDO),(ABN,INITDO),(SAVE)
         M:PFIL   M:DO,(EOF)
         M:OPEN   M:LO,(FILE,'GHOSTLO',':STATS'),(IN),; IS FILE THERE
                  (ERR,INITLO1),(ABN,INITLO1),(SAVE)
         M:CLOSE  M:LO,(SAVE)
INIT2A   M:OPEN   M:LO,(FILE,'GHOSTLO',':STATS'),(INOUT),;  UPDATE
                  (ERR,INITLO),(ABN,INITLO),(SAVE)
         M:PFIL   M:LO,(EOF)
         B        INIT4
INIT3A   EQU      %
         M:INT    LBREAK            GET BREAK CONTROL
         B        INIT4
INITSI   M:TYPE   (MESS,AT18)
         B        LEXIT             ERROR EXIT
INITDO   M:TYPE   (MESS,AT19)
         B        LEXIT             ERROR EXIT
INITLO   M:TYPE   (MESS,AT20)
         B        LEXIT             ERROR EXIT
INITLO1  M:OPEN   M:LO,(FILE,'GHOSTLO',':STATS'),(OUT),; CREATE FILE
                  (ERR,INITLO),(ABN,INITLO)
         M:CLOSE  M:LO,(SAVE)
         B        INIT2A
INITDO1  M:OPEN   M:DO,(FILE,'GHOSTDO',':STATS'),(OUT),;  CREATE FILE
                  (ERR,INITDO),(ABN,INITDO)
         M:CLOSE  M:DO,(SAVE)
         B        INIT1A
         B        LEXIT
*RETURN FROM BREAK
LBREAK   EQU      %
         STW,R1   PSDWZ             PSD WORD ZERO POINTER
         LI,R1    -1
         STW,R1   BFLG              SET BREAK CONTROL FLAG
         TYPE     'BREAK - STATS'
         B        LSTAR
INIT4    EQU      %
         TYPE     ' STATS B00 HERE'
         M:DEVICE M:LO,(VFC)
         M:DEVICE M:DO,(VFC)
         PAGE                       GET COMMAND
LSTAR    M:PC     '-'               RETURN TO COMMAND LEVEL
         LI,R     0
         STW,R    FCEXC
         LD,R     BLANK
         STD,R    COMMAND
         LI,1     80                BYTE COUNT, COMMAND INPUT
         LI,2     COMMAND
         BAL,ERETURN  READSI
         CI,R4    0                 TEST BYTE POINTER
         BL       LSTAR             REPEAT IF NAME ZERO LENGTH
         AI,R4    1                 BYTE DISPLACEMENT-->BYTE COUNT
         STW,R4   VSIZE             STORE FIELD LENGTH
         M:PC     '>'               CHANGE PROMPT CHARACTER
         LW,R8    COMMAND
         CW,R8    =C'PROC'          PROCEED FROM BREAK
         BE       LPRO
         LW,R1    BFLG
         CI,R1    -1                HAS A BREAK BEEN ISSUED
         BNE      %+8                    NO - CONTINUE
         LI,R1    0                      YES
         STW,R1   BFLG              RESET BREAK FLAG
*        RELEASE TEMP STACK USED BY BREAK CONTROL
         LW,R     *PSDWZ            GET FIRST WORD OF PSD IN TCB
         AND,R    =X'FFFE0000'      STRIP INSTRUCTION ADDRESS
         OR,R     =%+3              INSERT NEW ADDRESS IN PSD
         STW,R    *PSDWZ          PUT NEW PSD IN TCB
         CAL1,9   5                 EXIT FROM BREAK CONTROL
         PAGE
         LW,R9    =X'FF000000'      MASK LEFT BYTE
         LW,R8    COMMAND
         CW,R8    =C'ADD '
         BE       LADD
         CS,R8    =C'C   '
         BNE      %+6
         LW,R2    VSIZE
         AI,R2    -1
         LB,R2    COMMAND,R2
         CI,R2    C'!'              TEST FOR BANG IN LAST CHAR
         BE       LCON
         CW,R8    =C'END '
         BE       LEXIT
         CW,R8    =C'DROP'
         BE       LDROP
         CW,R8    =C'LIST'
         BE       LIST
         CS,R8    =C'BUIL'
         BE       LSETUP
         CW,R8    =C'TIME'
         BE       LTIME
         CW,R8    =C'DISP'
         BE       LUSE
         CW,R8    =C'FILE'
         BE       LFILE
         CS,R8    =C'*   '          COMMENT LINE - IGNORE
         BE       LSTAR
         CW,R8    =C'HELP'
         BE       LHELP
         TYPE     'ILLEGAL COMMAND'
         B        LSTAR             GO TO LSTAR
         PAGE
LHELP    EQU      %                 INTERACTIVE DESCRIPTION
         LI,R     100
         STW,R    NLINE
         BAL,RETURN  SPAGE
         TYPE     '  DESCRIPTION OF STATS COMMANDS'
         TYPE     'ADD        -  ADD PRINT FLAGS'
         TYPE     'B 0        -  RESET PRINT FLAGS'
         TYPE     'B(UILD) 1  -  BUILD DISPLAY FOR SYSTEM DISTRIBUTIONS'
         TYPE     'B 2        -  BUILD DISPLAY FOR SYSTEM AND PROCESSOR'
         TYPE     '              DISTRIBUTIONS'
         TYPE     'B 3        -  BUILD DISPLAY FOR 7 DISPLAY GROUPS'
         TYPE     'B 4        -  BUILD DISPLAY FOR SUMMARY (DEFAULT)'
         TYPE     'B 5        -  BUILD DISPLAY FOR SWAP DISTRIBUTIONS'
         TYPE     'CONTROL!   -  LIST SOME OF CONTROL PARAMS'
         TYPE     'DISPLAY    -  REPORT (AND UPDATE SNAPSHOT FILES)'
         TYPE     'DROP       -  DROP PRINT FLAGS'
         TYPE     'END        -  TERMINATE LISTS OR RETURN TO TEL'
         TYPE     'FILE       -  UPDATE SNAPSHOT FILES (AND REPORT)'
         TYPE     'LIST       -  LIST CURRENT FLAG STATUS'
         TYPE     'TIME       -  PRINTS CURRENT TIME'
         TYPE     'X          -  EXIT TO TEL'
         TYPE     '  DCB USAGE'
         TYPE     'M:SI - INTERACTIVE INPUT COMMANDS'
         TYPE     'M:LO - REPORTS'
         TYPE     'M:DO - INTERACTIVE OUTPUT'
         TYPE     'F:2  - CONSECUTIVE SNAPSHOT FILE'
         TYPE     'F:3  - KEYED SSNAPSHOT FILE'
         LI,R     100
         STW,R    NLINE
         BAL,RETURN  SPAGE
         B        LSTAR             GO TO LSTAR
         PAGE                       ADD COMMAND
LADD     TYPE     ' ENTER ITEMS TO BE ADDED'
LADD1    BAL,RETURN   SNAME         GET NAME.
         B        LSTAR             IF NO NAME, GOTO LSTAR.
         BAL,RETURN   SFIND   RI=ENTRY NO. OF THE NAME.
         B        LADD4
         LI,R     1           APRIN(RI)=1.
         STW,R    APRIN,RI
         B        LADD1             CONTINUE
LADD2    EQU      %
         TYPE     'NO SUCH NAME'
         B        LADD1
LADD4    EQU      %
         LD,R     NAME              TEST NAME
         CW,R     FEND              IS LIST TERMINATED
         BE       LSTAR
         CD,R     ALL               ARE ALL DISPLAYS DESIRED
         BE       ADAL                   YES-SET ALL PRINT FLAGS
         CD,R     SNAPS             SNAPSHOT PRINT FLAG
         BE       FSM                    YES
         CD,R     PRINS             REPORT FLAG
         BE       FSR                    YES
         LW,R     VSIZE             IF ONE CHARACTER,TEST FOR 0-5
         CI,R     1
         BNE      LADD2
         LB,R     NAME
         CI,R     C'0'
         BL       LADD2
         CI,R     C'5'
         BLE      LSETUP2           ADD STANDARD DISPLAY GROUP
         B        LADD2
         PAGE
ADAL     LI,R2    0                 SET FLAGS FOR GROUPS 1,3,4,5
SETAL1   AI,R2    1
         CI,R2    2                 IF FLAG GROUP 2
         BE       SETAL1                 YES - SKIP TO NEXT
         CI,R2    6                 ALL GROUPS HAVE BEEN ADDED
         BE       LADD1                  END OF ADD COMMAND
         LW,RIII  FLAGP,R2          GET WA(FIRST ITEM IN FLAG GROUP
SETAL2   MTW,0    0,RIII            IS GROUP TERMINATOR REACHED
         BEZ      SETAL1                 YES - GO TO NEXT GROUP
         LD,R12   *RIII
         BAL,RETURN  SFIND+1
         B        %+1
         LI,R1    1
         STW,R1   APRIN,RI          SET CORRESPONDING FLAG
         AI,RIII  2                 INCREMENT DOUBLE WORD POINTER
         B        SETAL2
FSM      LI,R     1
         STW,R    ISNAPF            SET SNAPSHOT FILE FLAG
         B        LADD1
FSR      LI,R     1
         STW,R    IPRNTF            SET REPORT WRITER FLAG
         B        LADD1
         PAGE                       DISPLAY CONTROL VALUES
LCON     LI,R1    1                 SET PRINT FLAG UNCONDITIONALLY
         STW,R1   PRNTF
         BAL,RETURN  GDAT           GET DATA
         LI,R     1                 FCEXC = 1
         STW,R    FCEXC
         BAL,RETURN  SPAGE
         PRINT    AT14,CTIME
         BAL,RETURN LGET1
         BAL,RETURN  LOUT1        PRINT SELECTED DATA
         LI,R     0
         STW,R    FCEXC             RESET FLAG
         B        LSTAR             CONTROL PROMPT
         PAGE                       EXIT COMMAND
*        CLOSE OPEN DCBS WITH SAVE
LEXIT    CLOSAVE  M:DO
         CLOSAVE  M:LO
         CLOSAVE  F:2
         CLOSAVE  F:3
         M:EXIT
         PAGE                       DROP COMMAND
LDROP    TYPE     ' ENTER ITEMS TO BE DROPPED'
LDROP1   BAL,RETURN   SNAME         GET NAME.
         B        LSTAR             IF NO NAME GOTO LSTAR.
         BAL,RETURN   SFIND   RI=ENTRY NO. OF THE NAME.
         B        LDROP4
         LI,R     0           APRIN(RI)=0.
         STW,R    APRIN,RI
         B        LDROP1            CONTINUE
LDROP2   EQU      %
         TYPE     'NO SUCH NAME'
         B        LDROP1
LDROP4   EQU      %
         LD,R     NAME              TEST NAME
         CW,R     FEND              IS LIST TERMINATED
         BE       LSTAR
         PAGE
         CD,R     SNAPS             SNAPSHOT FILE FLAG
         BE       FSMK                   YES
         CD,R     PRINS             REPORT FLAG
         BE       FSRK                   YES
         B        LDROP2
FSMK     LI,R     0
         STW,R    ISNAPF
         B        LDROP1
FSRK     LI,R     0
         STW,R    IPRNTF
         B        LDROP1
         PAGE                       LIST COMMAND
LIST     LI,R1    1
         STW,R1   PRNTF
         LI,R     100
         STW,R    NLINE
         BAL,RETURN  SPAGE
         TYPE     ' FLAG     -   STATUS'
         LI,RI    0
LIST1    AI,RI    1
         CI,RI    #PRTFLGS          ARE ALL FLAGS LISTED
         BG       LIST4
         LD,R10   ATERM1,RI         TRANSFER FLAG NAME TO BUFFER
         BYTRAN   8,4*R10,BA(BUFFER)+1
         MTW,0    APRIN,RI
         BEZ      LIST3
         BYTRAD   12,BA(ON)
         LI,R     21
LIST2    STW,R    VBUFCNT
         ATYPE
         B        LIST1
LIST3    BYTRAD   12,BA(OFF)
         LI,R     21
         B        LIST2
LIST4    LI,R     100
         STW,R    NLINE
         B        LSTAR             FLAGS ARE LISTED, PAGE SPACE READY
         PAGE
*PROCEED COMMAND
LPRO     EQU      %
         LW,R1    BFLG
         CI,R1    -1
         BNE      %+2
         CAL1,9   5                 EXIT FROM BREAK CONTROL
         B        LSTAR             CONTROL PROMPT
LTIME    M:TIME   TIME
         BYTRAN   16,BA(TIME),BA(BUFFER)+1
         LI,R     17
         STW,R    VBUFCNT
         ATYPE                      PRINT DATE TIME VIA M:DO
         B        LSTAR             RETURN TO COMMAND LEVEL
         PAGE                       SETUP COMMAND
LSETUP   EQU      %
         LW,RI    VSIZE
         AI,RI    -1                COMPUTE BYTE DISPLACEMENT.
LSETUP1  LB,R     COMMAND,RI
         CI,R     C'0'
         BL       %+3
         CI,R     C'5'
         BLE      LSETUP2
         BDR,RI   LSETUP1
         TYPE     'BUILD LIST ERROR'
         B        LSTAR
LSETUP2  AND,R    =X'F'
         LW,RI6   R
         LW,RIII  FLAGP,RI6
         LW,R     R
         BEZ      LSETUP2A
         LB,R     COMMAND
         CI,R     C'A'
         BE       LSETUP3-1
LSETUP2A LI,R9    0                 RESET ALL PRINT FLAGS
         LI,RII   #PRTFLGS
         STW,R9   APRIN,RII
         BDR,RII  %-1
         LI,R10   1
LSETUP3  LW,R12   0,RIII
         BEZ      LSETUP7
         AI,RIII  1
         LW,R13   0,RIII
         AI,RIII  1
         BAL,RETURN  SFIND+1
         B        LSETUP7
         LI,R10   1
         STW,R10  APRIN,RI
         B        LSETUP3
LSETUP7  EQU      %
         LB,R     COMMAND
         CI,R     C'A'
         BE       LADD1
         B        LSTAR
         PAGE                       DISPLAY COMMAND
LUSE     EQU      %
         LI,R1    0
         STW,R1   SNAPF             RESET FLAGS
         LI,R1    1
         MTW,0    ISNAPF
         BEZ      %+2
         STW,R1   SNAPF             WRITE SNAPSHOTS IF 'SNAPSHOT' ADDED
         STW,R1   PRNTF             PRINT REPORT UNCONDITIONALLY
         LI,R1    12                DEFAULT DISPLAY NUMBER
         STW,R1   ISNAP
         LI,R1    5*60              DEFAULT INTERVAL IN SECS
         STW,R1   VINT
         BAL,ERETURN  LMAP          MAP MONITOR & GET VIRTUAL PAGES
         B        LHIST
         PAGE                       FILE COMMAND
LFILE    LI,R1    0
         STW,R1   PRNTF
         LI,R1    1
         MTW,0    IPRNTF
         BEZ      %+2
         STW,R1   PRNTF             PRINT IF 'REPORT' WAS ADDED
         STW,R1   SNAPF             WRITE SNAPSHOT FILES UNCONDIT
         LI,R1    96                DEFAULT FILE SNAPSHOTS
         STW,R1   ISNAP
         LI,R1    15*60             DEFAULT INTERVAL IN SECS
         STW,R1   VINT
         BAL,ERETURN  LMAP          MAP MONITOR & GET VIRTUAL PAGES
LHIST    TYPE     ' ENTER INTERVAL IN MINUTES'
         BAL,RETURN  SDEC           READ SNAPSHOT INTERVAL
         B        LHIST             ERROR - RETRY
         LW,R3    VBINARY           LOAD RESULT
         BLEZ     %+4
         STW,R3   VMIN
         MI,R3    60                CONVERT TO SECONDS
         STW,R3   VINT
LHIST1B  TYPE     ' ENTER # OF INTERVALS'
         BAL,RETURN  SDEC           READ # OF SNAPSHOTS
         B        LHIST1B           ERROR - RE-TRY
         LW,R1    VBINARY           LOAD RESULT
         BLEZ     %+2
         STW,R1   ISNAP             STORE RESULT
         LI,R1    0
         STW,R1   VTIME2
         STW,R1   ICOUNT            ICOUNT=1,...,ISNAP
         BAL,RETURN  USNAP          OPEN SNAPSHOT FILES FOR UPDATE
                  PAGE
LHIST2   BAL,RETURN  LWAIT          WAIT FOR REST OF INTERVAL
         BAL,RETURN  GDAT           TRANSFER MONITOR DATA
         BAL,RETURN  LGET1          PROCESS DATA
         MTW,0    ICOUNT            TEST RECORD COUNT
         BEZ      LHIST2A
         BAL,RETURN  SPAGE
*        'STATISTICS ON-LINE'
*        'INTERVAL FROM ',A5,' TO ',A16
         LI,R1    5
         STB,R1   DTIME             TEMP CHANGE BYTE COUNT
         PRINT    AT13
         PRINT    AT3,DTIME,AT4,CTIME
         LI,R1    16
         STB,R1   DTIME             RETURN BYTE COUNT TO NORMAL
         BAL,RETURN  LOUT1
         BAL,RETURN  WSNAP
LHIST2A  EQU      %
         MTW,1  ICOUNT            INCREMENT INDEX
         LW,R1    ICOUNT
         CW,R1    ISNAP             ARE SNAPSHOTS COMPLETED
         BLE      LHIST2                 NO - GET ANOTHER
         PAGE                       SNAPSHOT HISTORY COMPLETED
         BAL,RETURN  CSNAP          CLOSE SNAPSHOT FILES
         B        LSTAR
         PAGE
F:2      DSECT    1
F:2      M:DCB    (FILE,'SNAPSHOT'),(PASS),;
                  (CONSEC),(SEQUEN),(OUT),(SAVE),;
                  (BUF,SNAPSUM)
         PAGE
F:3      DSECT    1
F:3      M:DCB    (FILE,'SSNAPSHOT'),(PASS),;
                  (KEYED),(DIRECT),(OUT),(SAVE),;
                  (KEYM,15),(BUF,SNAPSUM)
         PAGE
         USECT    CONTROLP
         END      INIT

