***********************************************************************
*M*      JOBR     PROCESSES THE JOB CONTROL COMMAND
***********************************************************************
*P*
*P*      NAME:    JOBR
*P*
*P*      PURPOSE: TO PROCESS THE JOB CONTROL COMMAND AND TO OUTPUT TIME,
*P*               DATE,ID AND ACCOUNT.
*P*
*P*      DESCRIPTION: JOBR IS CALLED BY CCIR. A PRE-SCAN OF THE JOB
*P*               COMMAND IS MADE TO DETERMINE WHETHER A WORK STATION
*P*               NAME(WSN) IS SPECIFIED. ALSO THE EXISTENCE OF A
*P*               REMOTE BATCH ID(RBID) IN THE JIT IS DETERMINED. IN
*P*               EITHER CASE THE LDEV PROCESSOR IS CALLED. UPON
*P*               RETURNING TO JOBR FROM LDEV PROCESSING OR IN INSTANCES
*P*               WHERE LDEV PROCESSING ISN'T REQUIRED, THE JOB COMMAND
*P*               IS PROCESSED AND PARAMETERS STORED IN THE JIT. THE
*P*               LOGRT ROUTINE IS CALLED FOR USER VALIDATION AND JOB
*P*               INITIATION. THE TIME,DATE,ID, AND ACCOUNT ARE OUTPUT
*P*               TO THE LL DEVICE.
*P*
*P*      REFERENCE: BATCH PROCESSING REFERENCE MANUAL
*P*
JOBP     DSECT    1
         SYSTEM    BPM
         SYSTEM   SIG7FDP
DEBUG    EQU      0
         PAGE
*                 SYMBOLIC REGISTER DEF'S.
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6
R7       EQU      7
SR1      EQU      8
SR2      EQU      9
SR3      EQU      10
SR4      EQU      11
D1       EQU      12
D2       EQU      13
D3       EQU      14
D4       EQU      15
         PAGE
*                 CHANGE STACK POINTER AMOUNT SPEC. BY 1ST ARGUMENT.
*                 SECOND ARGUMENT SPEC. AVAILABLE REGISTER.
BUMP     CNAME
         PROC
LF       LI,AF(2) AF(1)
         MSP,AF(2)  TSTACK
         PEND
*                 PUSH OR PULL N WORDS SPECIFIED BY 1ST ARGU4ENT INTO
*                 REG'S STARTING AT 2ND ARGUMENT.
PUSH     CNAME    X'9',X'B'
PULL     CNAME    X'8',X'A'
         PROC
         DO       NUM(AF)=1
LF       GEN,1,7,4,3,17 0,NAME(1),AF(1),0,TSTACK
         ELSE
         DO       AF(1)=1
LF       GEN,1,7,4,3,17  0,NAME(1),AF(2),0,TSTACK
         ELSE
         DO       AF(1)=16
LF       LCI      0
         ELSE
LF       LCI      AF(1)
         FIN
         GEN,1,7,4,3,17  0,NAME(2),AF(2),0,TSTACK
         FIN
         FIN
         PEND
         PAGE
         DEF      JOBR              ENTRY POINT TO JOBR
         DEF      DATEON            LOGON DATE TO BE USED IN LOGRT
         DEF      LGNTM             LOGON TIME TO BE USED IN LOGRT
         DEF      UPASSW            USER PASSWORD TO BE USED IN LOGRT
         DEF      EXTACC            EXTENDED ACCOUNTING INFORMATION TO BE
*,*                                 USED IN LOGRT
         REF      TSTACK            INPUT/OUTPUT-PRESERVE REGISTERS
         REF      LISTDATE          OUTPUT-DATE, TIME AND ID ON PRINTOUT
         REF      GETACCN           GET ACCOUNT FROM JOB COMMAND
         REF      EOCCSCAN          PRINT JOB CONTROL COMMAND BEFORE
*,*                                 RETURNING TO CCIR
         REF      CHARSCAN          CHECK FOR SPECIFIED DELIMITERS ON
*,*                                 JOB COMMAND
         REF      PLB               BUFFER CONTAINING LAST FIELD SCANNED
*,*                                 ON JOB COMMAND
         REF      CSL               DETERMINE IF LAST FIELD SCANNED ON
*,*                                 JOB COMMAND EXCEEDS MAXIMUM LENGTH
         REF      BAPLB             BYTE ADDRESS OF BUFFER CONTAINING
*,*                                 LAST FIELD SCANNED ON JOB COMMAND
         REF      ACCN              INPUT/OUTPUT- EQU; ACCOUNT NUMBER IN
*,*                                 JIT FROM JOB COMMAND
         REF      UNAME             INPUT/OUTPUT- EQU; USER NAME IN JIT
*,*                                 FROM JOB COMMAND
*,*                                 OUTPUT-BYTE 0; INDICATE
*,*                                 TO LOGOFF THAT AN
*,*                                 ILLEGAL USER LOGGED ON AND NO
*,*                                 ACCOUNTING RECORD IS TO BE GENERATED
         REF      JOBCCLF           EQU; CONTROL COMMAND LIST FLAGS
         REF      BLNKERCD          ERROR CODE CONSTANT
         REF      COMERCD           ERROR CODE CONSTANT
         REF      NAMERCD           ERROR CODE CONSTANT
         SREF     M:ACINIT          INPUT-ADDRESS OF INSTALLATION'S JOB
*,*                                 INITIATION ACCOUNTING ROUTINE
         REF      INSTARCD          ERROR CODE CONSTANT
         REF      RPERCD            ERROR CODE CONSTANT
         REF      SYNTXER           ERROR CODE CONSTANT
         REF      SCCLF             SET DEVICES ON WHICH TO LIST JOB
*,*                                 COMMAND
         REF      LIST              PRINT SYSID AND ACCOUNT (BLOCK PRINT)
         REF      TOPPAGE           SKIP TO TOP OF FORM AFTER BLOCK
*,*                                 PRINTING OF ACCOUNT
         REF      CHSTSCAN          GET NAME, EXTENDED ACCOUNTING,
*,*                                 ETC. FIELD FROM JOB COMMAND
         REF      LOGRT             CALL LOGRT ROUTINE TO LOG USER ON
         REF      HEXBCD            CONVERT SYSID FROM JIT TO BCD
         REF      BLANK             INPUT-BLANKS USED TO BLANK OUT DATA
*,*                                 AREAS
         REF      J:JIT             INPUT/OUTPUT-USER INFORMATION
         REF      J:ASSIGN          OUTPUT-BIT4; SET FLUSH JOB BITS ON
*,*                                 ABORTS IN JOBR
         REF      WSNERCD           ERROR CODE CONSTANT
         REF      J:DWSK            OUTPUT-WORK STATION NAME FROM JOB
*,*                                 COMMAND PASSED TO LDEV
         REF      Y008              CONSTANT
         REF      Y00FF             CONSTANT
         REF      CCBEF             OUTPUT-BIT8; SET CONTROL COMMAND
*,*                                 BUFFER FULL FLAG
         REF      J:TELFLGS         INPUT-BIT16; DETERMINE IF WORK STATION
*,*                                 NAME WAS VALID ON FIRST SCAN OF JOB
*,*                                 COMMAND
*,*                                 OUTPUT-BIT 17; INDICATE LDEV
*,*                                 PROCESSOR CALLED TO PROCESS WORK
*,*                                 STATION NAME
         REF      JRBID             INPUT-BYTE1; DETERMINE IF REMOTE
*,*                                 BATCH ID EXISTS IN THE JIT
         REF      CCLFLAGS          OUTPUT-BIT 23; SET LIST CONTROL
*,*                                 COMMAND FLAG IN JIT
         REF      CCREAD            REREAD JOB CONTROL COMMAND
         REF      EXITM             RETURN TO CCIR WHICH EXITS TO THE
*,*                                 LDEV PROCESSOR
         REF      SV:FTYM           INPUT-EQU; SIZE OF LOGICAL DEVICE
         REF      GETPASSW          GET PASSWORD FROM COMMAND AND BLANK
*,*                                 IT OUT IN BUFFER
         REF      SCRAM             SCRAMBLE THE PASSWORD
*,*                                 TABLE
         REF      SH:SYMT           INPUT-DETERMINE INDEX OF LOGICAL
*,*                                 DEVICE
         REF,2    JH:LDCF           INPUT-DETERMINE IF LOGICAL DEVICE
*,*                                 CONTROL FLAG SET FOR 'RP'
         REF      RPROERCD          ERROR CODE CONSTANT
         REF      RECORD            OUTPUT-ZERO OUT PASSWORD IN BUFFER
         REF      CLD               OUTPUT-EQU; MODIFY ORIGINAL LIST OF
*,*                                 SCAN TERMINATORS
         REF      EXTACLD           INPUT-LIST OF TERMINATORS FOR EXTENDED
*,*                                 ACCOUNTING SCANNING
         REF      PACLD             INPUT-LIST OF TERMINATORS FOR PASSWORD
*,*                                 SCANNING
         REF      CHSTERCD          ERROR CODE CONSTANT
K1       EQU      1
K2       EQU      2
K3       EQU      3
KC       EQU      X'C'
KFF      EQU      X'FF'
KBLANK   EQU      ' '
BPERL    EQU      140               # BYTES PER LINE             MAGIC
ORIGIN   EQU      3                 ORIGINAL BYTE OFFSET
WIDTH    EQU      13+4              TOTAL WIDTH
ACTWID   EQU      13                CHARACTER WIDTH
HIGH     EQU      12                CHARACTER HEIGHT
LNTOLN   EQU      BPERL-ACTWID      # TO ADD TO SET TO NEXT LINE
LISTDATA EQU      0                 DON'T LIST  EQU 0,LIST  EQU POS.
*
LR:PW    EQU      6                 PASSWORD
         PAGE
         CSECT    0
         BOUND    8
TYMBUF   RES      4                 TIME DATA BUFFER
UPASSW   DO1      2
         DATA     X'40404040'       PASSWORD FROM JOB CARD
DATEON   DATA     0                 START TIME IN YY,DD(BIN.,JULIAN)
LGNTM    DATA     0                 LOGON TIME
EXTACC   DO1      6                 EXT. ACC. INFO.
         DATA     X'40404040'
         USECT    JOBP
*        GET PAGE PLIST
GPGE     GEN,8,24 8,1
*        FREE PAGE PLIST
FPGE     GEN,8,24 9,1
         BOUND    8
XES      TEXT     'XXXXXXXX'
LDEV     TEXTC    'LDEV'
SPACE    TEXTC    ' '
IDEQ     GEN,24,8 'ID=',0
1STWD    GEN,8,24 133,'   '
TXTRP    TEXT     'RP  '
TERMS    DATA     X'004B2640'       SCAN TERMINATORS (PERIOD,EOB,BLANK)
         PAGE
*        JOBR -   JOB CONTROL COMMAND PROCESSOR-
*        PERFORMS ENDJOB FUNCTIONS, PROCESSES JOB CC, AND OUTPUTS
*        TIME AND DATE.
*        ENTER WITH
*                 (R5) = JIT POINTER
*                 (R7) = CC PARAMETER LIST
*                 (SR1)= CUR CHAR
*                 (SR4) = RETURN ADDR TO CCIR
*        IF JOB CC IS IN ERROR, THE FLUSH BIT IS SET IN THE JIT
*
JOBR     EQU      %
         PUSH     SR4
*
         PUSH     3,SR1             WILL BE WRITTEN OVER BY M:TIME
         M:TIME   TYMBUF,TUN        GET TIME IN BINARY AND EBCDIC
         STW,SR1  DATEON
         LB,R1    SR2               LOAD BIN HRS
         MI,R1    60*60             CVRT TO SECS
         STW,R1   LGNTM             SAVE
         SLS,SR2  8                 GET MINS TO BYTE 0
         LB,R1    SR2               GET MINS
         MI,R1    60
         AWM,R1   LGNTM             ADD TO CONVERTED HRS
         SLS,SR2  8                 SHIFT IN SECS
         LB,R1    SR2               GET THEM
         AWM,R1   LGNTM             ADD TO CONVERTED HRS & MINS
         PULL     3,SR1
* SCAN JOB CARD FOR WORK STATION NAME, CALL LDEV IF ONE EXISTS.
         LI,R1    X'4000'           WAS LDEV PROCESSOR CALLED
         AND,R1   J:TELFLGS
         BNEZ     JOBR30            IF SO, SKIP CODE WHICH SCANS WSN
         STD,R1   J:DWSK            PRESET WSN TO ZERO
         LI,D2    4                 GET WSN FIELD
         BAL,SR4  GETFLD
         MTW,0    D2                DID ONE EXIST
         BNEZ     JOBR25            NO
         LW,R2    PLB,R7            GET WSN
         LW,R3    PLB+1,R7
         CW,R2    BLANK             WAS WSN FIELD BLANK
         BE       JOBR25            YES, HENCE NO WSN SPEC'D
         STD,R2   J:DWSK
JOBR20   EQU      %
         LI,R3    X'4000'           SET 'LDEV CALLED' BIT ON
         STS,R3   J:TELFLGS
         LD,R6    LDEV
         PULL     SR4
         B        EXITM             CALL LDEV
JOBR25   EQU      %
         LW,R1    Y00FF             TEST FOR REMOTE BATCH ID
         LS,R1    JRBID,R5
         BNEZ     JOBR20            YES, ONE EXISTS
JOBR30   EQU      %
         LW,R1    Y008              REREAD JOB CARD
         STS,R1   CCBEF,R5          SET CC BUF FULL FLAG
         LI,R2    0
         LI,R3    X'4100'           RESET LDEV FLAG; SET LIST CC FLAG
         STS,R2   CCLFLAGS,R5       SET FLAG TO PRINT
         BAL,SR4  CCREAD
         LD,D1    XES               INITIALIZE ACCT. #
         LCI      2                                    TO
         STM,D1   ACCN,R5                                XXXXXXXX.
         STM,D1   UNAME,R5          INIT. NAME TO XXXXXXXX.
         CI,SR1   KBLANK            CHECK IF CUR CHAR IS A BLANK
         BNE      JOBR100           ERROR IF NOT A BLANK
         BAL,SR4  GETACCN           GET ACCOUNT NUMBER
         BCS,8    JOBR200           BRANCH IF ILLEGAL ACCN
         LCI      K2                MOVE
         LM,R2    PLB,R7                ACCOUNT
         STM,R2   ACCN,R5                      NUMBER TO JIT
         LI,SR2   ','
         BAL,SR4  CHARSCAN          CHECK FOR COMMA
         BCS,8    JOBR120
         BAL,SR4  CHSTSCAN          GET NAME FIELD                      905
         BCS,8    JOBR130           BRANCH IF NOT A LEGAL NAME
         LW,R1    CSL,R7            (R1) = LENGTH OF NAME
         CI,R1    KC                CHECK IF NAME <= 12 CHAR
         BG       JOBR130           ERROR IF NOT
         LCI      K3                MOVE
         LM,R2    PLB,R7                USER'S
         STM,R2   UNAME,R5          NAME TO JIT
*EXT. ACC. FIELD IN JOB COMMAND CARD
*  '(' AND ')' ARE ASSUMED TO BE DELIMITERS
*
*
         LI,R1    6                 CLEAR THE
         LW,R2    BLANK                 EXT. ACC. FIELD
         STW,R2   EXTACC-1,R1              TO
         BDR,R1   %-1                          BLANKS
*
         LI,R4    0                 PROB:ONLY NAME-ACC ON JOB CC
         BAL,SR4  SCCLF             FIX IT:DONT LIST ON OC(OR ANTHG)
*
         LI,SR2   '('               CHECK FOR PRESENCE OF EXT.ACC. FIELD
         BAL,SR4  CHARSCAN
         BCS,8    JOBR37
         LW,SR4   EXTACLD           USE EXT. ACCT. DELIMITERS FOR SCAN.
         XW,SR4   CLD,R7
         PUSH     SR4
         BAL,SR4  CHSTSCAN          GET EXT. ACC. FIELD
         BCS,12   JOBREXT1          NOT LEGAL ACCT. FIELD
         PULL     SR4
         STW,SR4  CLD,R7            RESTORE STANDARD SET OF DELIMITERS
         LW,R1    CSL,R7            (R1)=LENGTH OF EXT.ACC. IN BYTES
         CI,R1    24                CHECK IF EXCEEDS MAX
         BLE      %+2
         LI,R1    24                IF>24,ONLY WANT 24
         LI,R3    BAPLB             EXTACC SHOULD NOW BE IN CC PAREMETER LIST
         LI,R4    0                 COUNT FOR WDS STORED
JOBR35   EQU      %
         LB,R2    *R7,R3            EXTRACT FROM CCPL
         STB,R2   EXTACC,R4         STORE INTO AREA FOR EXTACC
         AI,R4    1
         CW,R4    R1                SEE IF ALL MOVED
         BGE      %+3
         AI,R3    1
         B        JOBR35
         LI,SR2   ')'               CHECK FOR RIGHT PAREN.
         BAL,SR4  CHARSCAN
         BCS,8    JOBREXT2          EXTACC NOT ENDED WITH RHT PAREN.
         LI,SR2   ','               CHECK IF ANOTHER COMMA PRESENT
         BAL,SR4  CHARSCAN
         BCS,8    JOBR40            NOPE
JOBR37   EQU      %
         LI,D2    2                 SKIP PRI AND WSN FIELDS
         BAL,SR4  GETFLD
         CI,SR1   ','               DOES PASSWORD EXIST
         BNE      JOBR40            NO
         LW,SR4   PACLD             USE PASSWORD DELIMITERS FOR SCANNING
         XW,SR4   CLD,R7
         PUSH     SR4
         LI,SR1   0
         BAL,SR4  GETPASSW          GET PASSWORD
         BCS,8    JOBR140           BRANCH IF ILLEGAL
         PULL     SR4
         STW,SR4  CLD,R7            RESTORE STANDARD SET OF DELIMITERS
         LW,R2    CSL,R7
         CI,R2    8                 CAN'T BE >8 CHARACTERS
         BG       JOBR140C          ERROR
         PUSH     R7
         LCI      2
         LM,D1    PLB,R7
         BAL,SR4  SCRAM             SCRAMBLE THE PASSWORD
         STD,R6   UPASSW            SAVE PASSWORD FOR LOGRT
         PULL     R7
JOBR40   EQU      %
         LI,SR1   0                 SET CURR. CHAR. TO 0
         LI,SR3    0
*
* NOW THAT JOB COMMAND SYNTAX IS CORRECT, LOG USER ON.
*
*
         PUSH     5,R4              SR2 WILL BE USED TO HOLD ERRCODE
         BAL,11    LOGRT
         PULL     5,R4
         AI,SR3    0
         BGZ      JOBRACC           ERROR, DONT GEN. ACCNTG. RECORD
         BLZ      JOBRACC5          ERROR, GEN. ACCTNG. RECORD
*
         LI,SR4   X'8000'           IF WSN, WAS IT VALID
         CW,SR4   J:TELFLGS
         BANZ     JOBR300           NO
*
         LW,R1    Y00FF             IF REMOTE PROC. IS IT AUTHORIZED
         LS,R1    JRBID,R5
         BEZ      JOBR55            ASSIGNED TO LOCAL
         LI,R1    SV:FTYM
JOBR45   EQU      %
         LH,SR4   SH:SYMT,R1        GET INDEX OF LOGICAL EVICE 'RP'
         CH,SR4   TXTRP
         BE       JOBR50
         BDR,R1   JOBR45
         B        JOBR55
JOBR50   EQU      %
         LCW,R1   R1                DETERMINE WHICH BIT IS FOR DEVICE 'RP'
         LI,D4    X'8000'
         SLS,D4   0,R1
         LI,R2    JH:LDCF           GET LOGICAL DEVICE CONTROL FLAGS
         CH,D4    0,R2              IF BIT NOT SET FOR DEVICE 'RP'
         BAZ      JOBR160           NO AUTHORIZATION FOR REMOTE PROC.
JOBR55   EQU      %
* NOW THAT THE AUTHORIZATION CHECHS ARE MADE, EXIT TO THE INSTALLATION
* JOB INITIATION ACCOUNTING ROUTINE VIA SREF M:ACINIT (IF NONE,
* BECOMES NOP) VIA REGISTER 15.
* REGISTER 3 CONTAINS THE ADDRESS OF THE LOGON RECORD,REGISTER 5 THAT OF
* THE JIT. THE INSTALLATION CAN THAEN POLICE THE JOB OR MODIFY THE JIT.
***UPON RETURN, IF R3 SET TO ZERO, THE JOB WILL BE ABORTED***
***REGISTERS EXCEPT R3 ARE EXPECTED TO BE INTACT***
*
JOBOK    LI,15    M:ACINIT
         BEZ      %+4               NOT THERE
         BAL,15   *15
         CI,R3    0
         BE       JOBRINS
*
         DO       DEBUG
         NOP
         ELSE
         BAL,SR4  HERALD            PRINT ID AND ACCT. #
         FIN
         BAL,SR4  EOCCSCAN          SKIP TO END OF CONTROL COMMAND
         LI,R2    -2                CLOBBER THE PASSWORD IN BUFFER
         STW,R2   RECORD+LR:PW+2,R2 TO PREVENT FUTURE USERS OF THIS PAGE
         BIR,R2   %-1               FROM STEALING IT.
         PULL     SR4
         AI,SR4   5
         B        *SR4
*
         PAGE
JOBR100  EQU      %
*E*      MESSAGE: EXPECTED BLANK MISSING
*E*      DESCRIPTION: THE DELIMITER WHICH FOLLOWED JOB ON THE JOB
*E*               CONTROL COMMAND WAS NOT A BLANK.
         LI,SR3   BLNKERCD          (SR3) = BLANK ERR CODE
         B        JOBR200
*
JOBR120  EQU      %
*E*      MESSAGE: EXPECTED COMMA MISSING
*E*      DESCRIPTION: A COMMA WAS NOT USED TO SEPARATE THE NAME AND
*E*               ACCOUNT FIELDS ON THE JOB CONTROL COMMAND.
*E*
         LI,SR3   COMERCD           (SR3) = COMMA ERR CODE
         B        JOBR200
*
JOBR130  EQU      %
*E*      MESSAGE: ILLEGAL ALPHANUMERIC NAME
*E*      DESCRIPTION: THE FIELD CONTAINS AN ILLEGAL CHARACTER OR
*E*               IT EXCEEDS THE MAXIMUM LENGTH.
         LI,SR3   NAMERCD           (SR3) = NAME ERR CODE
         B        JOBR200
*
JOBR140  EQU      %
         PULL     SR4
*E*      MESSAGE: ILLEGAL CHARACTER STRING
*E*      DESCRIPTION: THE FIELD CONTAINS AN ILLEGAL CHARACTER OR IT
*E*                   EXCEEDS THE MAXIMUM LENGTH.
JOBR140C EQU      %
         LI,SR3   CHSTERCD          (SR3) = CHARACTER STRING CODE
         B        JOBR200
*
*
JOBR160  EQU      %
*E*      MESSAGE: USER NOT AUTHORIZED FOR REMOTE PROCESSING
         LI,SR3   RPROERCD          (SR3) = REMOTE PROCESSING ERROR CODE
         B        JOBR200
*
*
JOBREXT1 EQU      %
         PULL     SR4
*E*      MESSAGE: SYNTAX ERROR
         LI,SR3   SYNTXER           (SR3)=EXT.ACC.SYNTAX CODE
         B        JOBR200
*
JOBREXT2 EQU      %
*E*      MESSAGE: EXPECTED RIGHT PARENTHESIS MISSING
*E*      DESCRIPTION: THE EXTENDED ACCOUNTING FIELD WAS NOT TERMINATED
*E*               WITH A RIGHT PARENTHESIS.
         LI,SR3   RPERCD            (SR3)=RIGHT PAREN. ERROR CODE
         B        JOBR200
*
JOBRINS  EQU      %
*E*      MESSAGE: INSTALLATION PROHIBITS YOUR LOGGING ON
*E*      DESCRIPTION: THE USER IS PROHIBITED BY THE INSTALLATION FROM
*E*                   HAVING FURTHER ACCESS TO THE SYSTEM.
         LI,SR3   INSTARCD
         B        JOBR200
JOBR200  EQU      %
         LW,R1    =X'08000000'      L/BIT 4
         STS,R1   J:ASSIGN          S/BIT 4 (FLUSH BIT) IN J:ASSIGN
         DO       DEBUG
         NOP
         ELSE
         BAL,SR4  HERALD            PRINT ID AND ACCT.  #
         FIN
         BAL,SR4  EOCCSCAN          *PRINT CC ON ABORT
         LI,R2    -2                CLOBBER THE PASSWORD IN BUFFER
         STW,R2   RECORD+LR:PW+2,R2 TO PREVENT FUTURE USERS OF THIS PAGE
         BIR,R2   %-1               FROM STEALING IT.
         PULL     SR4
         B        *SR4
JOBR300  EQU      %
         LI,SR3   WSNERCD           (SR3) = WSN ERROR CODE
*E*      MESSAGE: INVALID WORK STATION NAME
*E*      DESCRIPTION: THE WORK STATION NAME SPECIFIED ON THE JOB CONTROL
*E*               COMMAND WAS INVALID.
         B        JOBR200
JOBRACC  RES       0
* INDICATE TO LOGOFF THAT USER IS INVALID OR A/M COULDN'T BE CREATED
* AND NO ACCOUNTING RECORD IS TO BE GENERATED. SETTING FF IN BYTE 0
* OF THE JIT INDICATES TO LOGOFF THAT NO ACCOUNTING RECORD IS TO BE
* GENERATED FOR THIS USER SINCE HE IS ILLEGAL.
         LI,SR3   KFF
         STB,SR3  J:JIT+UNAME
JOBRACC5 EQU      %
         LW,SR3   SR2               SR2 CONTAINS ERROR CODE FROM LOGRT
         B         JOBR200
         PAGE
* THE GETFLD ROUTINE OBTAINS THE SPECIFIED FIELD FROM THE JOB COMMAND.
*        ENTER    BAL,SR4  GETFLD
*        INPUT    D2 = NUMBER OF FIELD TO OBTAIN FROM JOB COMMAND
*        OUTPUT   D2 = 0 IF SPEC'D FIELD WAS FOUND AND STORED IN THE PLB
*                    = NOT EQUAL 0 IF SPEC'D FIELD NOT PRESENT
*
GETFLD   EQU      %
         PUSH     SR4
GETFLD3  EQU      %
         LI,SR1   0
         BAL,SR4  CHSTSCAN          GET FIELD
         LI,SR2   ','
         BAL,SR4  CHARSCAN          WAS CHARACTER SCANNED A COMMA
         BCS,8    GETFLD5
         AI,D2    -1                YES
         BEZ      GETFLD15          EXIT IF SPEC'D NUMBER OF FIELDS SKIPPED
         B        GETFLD3
GETFLD5  EQU      %
         LI,R2    3
         CB,SR1   TERMS,R2          EXIT IF PERIOD, BLANK, OR END OF MSGE.
         BE       GETFLD10          TERMINATED SCAN
         BDR,R2   %-2
         B        GETFLD3
GETFLD10 EQU      %
         AI,D2    -1                ADJUST FIELD COUNT
GETFLD15 EQU      %
         PULL     SR4
         B        *SR4              EXIT
         PAGE
*
*  *  *       BLOCK  PRINT  SYS  ID  AND  JOB  ACCT.  #
*
HERALD   EQU      %
         PUSH     16,R0             SAVE REGS
         BAL,SR4  PRNTSID           PRINT SYSTEM ID
         LCI      K2
         LM,D1    ACCN,R5           LOAD ACCT.  #
         PUSH     2,D1              REMEMBER ACCOUNT #
         BAL,SR4  PRNTACNT          PRINT ACCOUNT #
         LI,R4    K2
         BAL,SR4  TOPPAGE           SKIP TO TOP OF FORM
         BAL,SR4  PRNTSID
         PULL     2,D1              GET ACCOUNT # BACK
         BAL,SR4  PRNTACNT          PRINT ACCOUNT AGAIN
         LI,R4    2
         BAL,SR4  TOPPAGE
         BAL,SR4  LISTDATE
         LI,R4    JOBCCLF
         BAL,SR4  SCCLF
         PULL     16,R0             RESTORE REGS
         B        *SR4
         PAGE
PRNTSID  EQU      %
         PUSH     SR4
         LW,D1    *R5               GET SYSTEM ID FROM JIT
         SLS,D1   16
         BAL,D4   HEXBCD
         SLD,D1   -24
         AW,D1    IDEQ              ADD IN 'ID=' FIELD
         LI,4     7                 SET # CHARS TO PRINT
PRNTSID1 BAL,SR4  BLKPRT
         PULL     SR4
         B        *SR4
PRNTACNT EQU      %
         PUSH     SR4
         LI,4     8                 SET # CHARS TO PRINT
         B        PRNTSID1
* * * * * * * * *
         LOCAL    L1,L2,L3,L4,L5
BLKPRT   EQU      %                 BLOCK PRINT ROUTINE
         PUSH     16,R0             SAVE ALL REGS
         CAL1,8   GPGE              GET A PAGE OF STORAGE
         LW,1     SR2               SR2 HAS ADDRESS
         LI,2     511
         LW,3     BLANK
         STW,3    *1,2              BLANK ALL OF STORAGE
         BDR,2    %-1
         LW,3     1STWD
         LI,SR1   HIGH
         STW,3    *1,2              INITIALIZE ALL BYTE COUNTS
         AI,2     BPERL/4
         BDR,SR1  %-2
         LI,R3    ORIGIN            SET STARTING BYTE DISP
L4       LB,SR1   D1                GET CHAR TO PRINT
         LI,SR2   ' '               LOAD ALTERNATE CHARACTER
         LI,2     TABSIZE
         CB,SR1   TAB,2             FIND PROPER CONVERSION TABLE
         BE       %+2
         BDR,2    %-2
         LW,D3    R3                REMEMBER STARTING WORD
         LW,2     TABADS,2          GET ADDRESS OF TABLE
         LI,7     1                 GET 1ST OFFSET
         LB,0     *2                GET # BYTES IN TABLE
         LI,SR3   ACTWID            GET # CHARS PER LINE
L2       LB,D4    *2,7              GET # CHARS THE SAME
         BEZ      CHANGE            CHANGE CHARACTER
L1       STB,SR1  *1,3              STORE A CHAR
         AI,3     1                 INCR DISP
         BDR,SR3  L3                LOOP FOR 1 LINE
         AI,3     LNTOLN            CHANGE TO NEXT LINE OF THIS CHAR
         LI,SR3   ACTWID            RE-INIT COUNTER
L3       BDR,D4   L1                LOOP ON # CHARS THE SAME
CHANGE   XW,SR1   SR2               CHANGE CHARACTERS
         AI,7     1
         BDR,R0   L2                GET NEXT CONTROL BYTE
         LW,R3    D3                RESET START
         AI,R3    WIDTH             SKIP TO NEXT CHAR
         SLD,D1   8                 SHIFT NEXT CHAR INTO PLACE
         BDR,4    L4                LOOP ON # CHARS TO PRINT
         LI,SR1   HIGH              # LINES TO PRINT
         LW,R2    R1                SET ADDRESS
L5       LI,D4    3                 BYTE DISP.
         LI,R4    K2                DEVICE
         BAL,SR4  LIST              PRINT IT
         AI,R2    BPERL/4           INCREMENT BUFFER
         BDR,SR1  L5
         LI,R2    6                 UPSPACE
         M:PRINT  (MESS,SPACE)             PRINTER
         BDR,R2   %-1                                8 LINES.
         CAL1,8   FPGE              RELEASE DATA BUFFER
         PULL     16,R0
         B        *SR4
****
         DO       LISTDATA=0
         FIN
      DO  LISTDATA>0
         PAGE
      FIN
*        BLOCK PRINT DATA
* * * * * * *
A        DATA,1   21,0,1,11,1,15,9,4,9,4,9,30,9,4,9,4,9,4,9,4,9,2
         BOUND    4
B        DATA,1   19,12,1,15,9,4,9,4,9,14,1,12,1,2,9,4,9,4,9,27
         BOUND    4
C        DATA,1   23,0,1,11,1,15,9,4,11,2,11,2,11,2,11,2,11,2,11,2,9,15;
                  ,1,11
         BOUND    4
D        DATA,1   23,11,2,12,1,2,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,14,1,11
         BOUND    4
E        DATA,1   17,28,11,2,11,2,11,8,5,8,5,2,11,2,11,2,11,26
         BOUND    4
F        DATA,1   19,28,11,2,11,2,11,8,5,8,5,2,11,2,11,2,11,2,11,2
         BOUND    4
G        DATA,1   27,0,1,11,1,15,9,4,9,4,11,2,11,2,6,4,1,2,6,7,9,;
                  4,8,16,1,9,1,2
         BOUND    4
H        DATA,1   21,2,9,4,9,4,9,4,9,4,9,30,9,4,9,4,9,4,9,4,9,2
         BOUND    4
I        DATA,1   25,0,2,8,5,8,8,2,11,2,11,2,11,2,11,2,11,2,11,2,11,;
                  2,8,8,5,8
         BOUND    4
J        DATA,1   23,0,11,2,11,2,11,2,11,2,11,2,11,2,11,2,11,4,9,4,9,;
                  15,1,11
         BOUND    4
K        DATA,1   41,2,9,4,8,2,1,2,6,2,3,2,4,2,5,2,2,2,7,4,9,4,9,2,2,2,;
                  7,2,4,2,5,2,6,2,3,2,8,2,1,2,9,2
         BOUND    4
L        DATA,1   21,2,11,2,11,2,11,2,11,2,11,2,11,2,11,2,11,2,11,2,9,28
         BOUND    4
M        DATA,1   37,2,9,5,7,7,5,6,1,2,3,2,1,4,2,2,1,2,2,4,3,3,3,4,4,1,;
                  4,4,9,4,9,4,9,4,9,4,9,2
         BOUND    4
N        DATA,1   37,2,9,5,8,6,7,4,1,2,6,4,2,2,5,4,3,2,4,4,4,2,3,4,5,2,;
                  2,4,6,2,1,4,7,6,8,5,9,2
         BOUND    4
O        DATA,1   23,0,1,11,1,15,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,15,1,11
         BOUND    4
P        DATA,1   19,12,1,15,9,4,9,4,9,27,1,2,11,2,11,2,11,2,11,2
         BOUND    4
Q        DATA,1   27,0,1,11,1,15,9,4,9,4,9,4,9,4,9,4,9,4,4,2,3,4,5,2,2,;
                  15,1,11
         BOUND    4
R        DATA,1   29,12,1,15,9,4,9,4,9,27,1,2,6,2,3,2,7,2,2,2,8,2,1,2,8;
                  ,2,1,2,8,2
         BOUND    4
S        DATA,1   21,0,1,11,1,15,9,4,11,2,11,12,2,12,11,2,11,4,9,15,1,11
         BOUND    4
T        DATA,1   23,12,1,12,6,2,11,2,11,2,11,2,11,2,11,2,11,2,11,2,11,;
                  2,11,2
         BOUND    4
U        DATA,1   23,2,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,15,1,11
         BOUND    4
V        DATA,1   41,2,9,4,9,2,1,2,7,2,2,2,7,2,3,2,5,2,4,2,5,2,5,2,3,2,;
                  6,2,3,2,7,2,1,2,8,2,1,2,9,3,11,1
         BOUND    4
W        DATA,1   35,2,9,4,9,4,9,4,9,4,9,4,9,4,3,3,3,4,2,2,1,2,2,4,1,2,;
                3,2,1,6,5,7,7,5,9,2
         BOUND    4
X        DATA,1   43,2,9,2,1,2,7,2,3,2,5,2,5,2,3,2,7,2,1,2,9,3,10,3,9,;
                  2,1,2,7,2,3,2,5,2,5,2,3,2,7,2,1,2,9,2
         BOUND    4
Y        DATA,1   31,2,8,2,2,2,6,2,4,2,4,2,6,2,2,2,8,4,10,2,11,2,11,2,;
                  11,2,11,2,11,2,11,2
         BOUND    4
Z        DATA,1   23,25,1,2,7,2,10,2,10,2,10,2,10,2,10,2,10,2,10,2,7,2,;
                  1,25
         BOUND    4
#0       DATA,1   31,0,3,7,5,9,3,2,7,2,1,2,9,4,9,4,9,4,9,4,9,4,9,2,1,2,;
                  7,2,3,9,5,7
         BOUND    4
#1       DATA,1   25,0,5,2,10,3,9,4,11,2,11,2,11,2,11,2,11,2,11,2,11,2,;
                  11,2,11,2
         BOUND    4
#2       DATA,1   23,0,1,11,1,15,9,2,11,2,11,2,10,2,9,2,9,2,9,2,9,2,9,26
         BOUND    4
#3       DATA,1   23,0,1,11,1,15,9,2,11,2,11,2,8,4,9,4,12,2,11,2,11,15,;
                  1,11
         BOUND    4
#4       DATA,1   31,0,7,2,10,3,9,4,8,2,1,2,7,2,2,2,6,2,3,2,5,2,4,2,4,;
                  26,7,2,11,2,11,2
         BOUND    4
#5       DATA,1   17,28,11,2,11,2,11,12,1,13,11,2,11,4,9,15,1,11
         BOUND    4
#6       DATA,1   19,0,1,27,11,2,11,2,11,12,1,15,9,4,9,4,9,15,1,11
         BOUND    4
#7       DATA,1   23,25,1,2,7,2,10,2,10,2,10,2,11,2,10,2,11,2,10,2,11,2;
                  ,11,2
         BOUND    4
#8       DATA,1   25,0,1,11,1,15,9,4,9,4,9,2,1,11,2,11,1,2,9,4,9,4,9,15;
                  ,1,11
         BOUND    4
#9       DATA,1   19,0,1,11,1,15,9,4,9,4,9,15,1,12,11,2,11,2,11,27
         BOUND    4
COLON    DATA,1   13,0,18,3,10,3,10,3,62,3,10,3,10,3
         BOUND    4
MONEY    DATA,1   45,0,1,11,1,15,2,2,1,2,2,4,2,2,1,2,4,2,2,2,1,2,4,12,2;
                 ,12,4,2,1,2,2,2,4,2,1,2,2,4,2,2,1,2,2,15,1,11
         BOUND    4
EQUAL    DATA,1    5,0,39,26,26,26
         BOUND    4
ULINE    DATA,1   3,0,130,26
         BOUND    4
ASTERISK DATA,1   41,2,9,2,1,2,7,2,3,2,5,2,5,2,3,2,7,2,1,2,4,26,4,2,1,;
                  2,7,2,3,2,5,2,5,2,3,2,7,2,1,2,9,2
         BOUND    4
NUMBER   DATA,1   33,0,9,2,1,1,8,2,1,2,7,2,1,2,1,26,4,2,1,2,7,2,1,2,5,;
                  28,1,2,8,1,1,2,10,2
         BOUND    4
AT       DATA,1   44,0,3,7,5,9,3,2,7,2,1,2,2,5,2,4,1,7,1,4,1,2,3,2,1,4,;
                  1,2,3,4,1,2,1,8,2,2,2,6,4,2,12,9,5,7,3
         BOUND    4
DASH     DATA,1   3,0,65,26
         BOUND    4
TAB      TEXT     'ZYXWVUTSRQPONMLKJHGFECBA9876543210:%ID= ž*#@-'
TABSIZE  EQU      (4*(ABSVAL(%)-ABSVAL(TAB)))-4
TABADS   DATA     Z,Y,X,W,V,U,T,S,R,Q,P,O,N,M,L,K,J,H,G,F,E,C,B,A,#9,#8
         DATA     #7,#6,#5,#4,#3,#2,#1,#0,COLON,MONEY,I,D,EQUAL,BLKS
         DATA     ULINE,ASTERISK,NUMBER,AT,DASH
BLKS     DATA     0
         END

