         PAGE
R0       EQU      0
R1       EQU      1
VERSION  EQU      2                 1=BPM, 2=UTS
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
         TITLE    'PRTERR'
PRTERR   DSECT    1
PLSECT   CSECT    1
         SYSTEM   SIG7
*
* PRTERR          PRINT ERROR CODES
*
* INPUT
*        ERRFLAG  ERROR FLAG BUFFER
*        D2       MAXIMUM ERROR SEVERITY
* OUTPUT
*        PRINTED ERROR CODES AND MAXIMUM SEVERITY CODE ON LO DEVICE
*
*
         REF      PRTBUF
         REF      M:LL,M:DO,CMDBUF
         REF      IOERR,ERRFLAG,M:EI,CLOSEI,ERCMDBUF
         REF      BIN2BCD,HEX2BCD
         REF      J:JIT,M:UC
         REF      COPYSTDF
         REF      CMBX,CONTINUE
*
         USECT    PRTERR
         LCI      7                 SAVE REGISTERS
         PSM,R5   *R7
*
         LI,D3    M:UC
         MTW,0    J:JIT             ONLINE MODE
         BLZ      PERR1             YES
         LI,D3    M:DO              NO-ERROR OUTPUT ON M:DO
*
         CAL1,1   FPTCOMP           COMPARE M:LL AND M:DO
         USECT    PLSECT
FPTCOMP  GEN,8,7,17      X'2B',0,M:LL
         GEN,15,17             0,M:DO
         USECT    PRTERR
         CI,SR1   1                 SAME DEVICE
         BE       PERR1             YES
         LI,R1    CMDBUF            NO-PRINT COMMAND AGAIN ON M:DO
         AW,R1    R7
         CAL1,1   FPTCOMD
         USECT    PLSECT
FPTCOMD  GEN,8,7,17      X'11',0,M:DO
         DO1      VERSION=1
         DATA     X'34000010'
         DO1      VERSION=2
         DATA     X'30000010'
         PZE      *R1               BUFFER
         DATA     80                SIZE
         DO1      VERSION=1
         DATA     0
         USECT    PRTERR
PERR1    EQU      %
         DO       VERSION=2
         CAL1,1   FPTERROP          OPEN ERROR MESSAGE FILE
         USECT    PLSECT
FPTERROP GEN,8,7,17      X'14',0,M:EI
         DATA     X'C1000009'
         DATA     0                 REMOVE ANY ERROR
         DATA     0                 REMOVE ANY ABNORMAL
         DATA     1                 IN
         DATA     X'01000202'
         TEXTC    'ERRMSG'
         DATA X'02000202'
         TEXT     ':SYS    '
         DATA     X'07010003'
         DATA     0,0,0
         USECT    PRTERR
         FIN
         PAGE
         LI,R6    ERCMDBUF          ERROR FLAG LINE BUFFER
         AW,R6    R7
         LI,R3    72                CHARS IN BATCH COMMAND
         DO1      VERSION=1
         LI,R5    0
         MTW,0    J:JIT             BATCH MODE
         BGEZ     PRT1              YES-SKIP ERROR FLAG LINE TRUNCATION
         LI,R1    139
         LI,R2    ' '
         CB,R2    *R6,R1
         BNE      PRT2
         BDR,R1   %-2
         CB,R2    *R6
         BE       PRTERR5           NO FLAGS PRESENT
PRT2     EQU      %
         AI,R1    1
         LI,R2    X'15'
         STB,R2   *R6,R1            INSERT NL CHAR IN STRING
         AI,R1    1
         STB,R0   *R6,R1            PUT IN A ZERO TO TERM PRINTING  TTY
         LI,R6    ='    '
         LI,R3    1
         CAL1,1   FPTMESS           PRINT ONE BLANK CHAR UNDER PROMPT
         LI,R6    ERCMDBUF
         AW,R6    R7
         LI,R3    140               CHARS IN TERMINAL COMMAND
PRT1     CAL1,1   FPTMESS           PRINT ERROR FLAG LINE
         LI,R6    PRTBUF
         AW,R6    R7
         LW,R2    R7
         AI,R2    ERRFLAG
         LW,R1    ERRFLAG,R7        ANY PCL ERROR MESSAGES TO PRINT
         BEZ      PRTERR2           NO
         DO       VERSION=2
         CAL1,1   FPTSETER          SET ERR AND ABN ADDRESSES
         USECT    PLSECT
FPTSETER GEN,8,7,17    X'06',0,M:EI
         DATA     X'C0000000'
         DATA     ABNPCLER
         DATA     ABNPCLER
         USECT    PRTERR
PRTERR1  AI,R2    1                 ADDRESS OF MESSAGE KEY
         CAL1,1   FPTERORD          READ ERROR MESSAGE
         USECT    PLSECT
FPTERORD GEN,8,7,17      X'10',0,M:EI
         DATA     X'F8000010'
         DATA     ABNPCLER
         DATA     ABNPCLER          ABNORMAL FOR PCL ERROR CODE
         PZE      *R6               BUFFER ADDRESS
         DATA     80                SIZE
         PZE      *R2               KEY
         USECT    PRTERR
         LW,R3    M:EI+4
         SLS,R3   -17               SIZE OF ERROR MESSAGE
         MTW,0    J:JIT             ONLINE
         BLZ      %+2               YES
         AI,R3    -1                NO-REMOVE NL GOING PRINTER
         ELSE
PRTERR1  AI,R2    1
         LW,R6    *R2               GET ERROR NO.
         LW,R6    MSGADR-1,R6       GET MESSAGE ADDRESS
         LB,R3    *R6               SIZE OF MESSAGE
         LI,R5    1
         FIN
PRTERR4  CAL1,1   FPTMESS           PRINT PCL ERROR MESSAGE
         USECT    PLSECT
FPTMESS  GEN,8,7,17      X'91',0,D3
         DATA     X'34000010'
         PZE      *R6
         PZE      *R3
         DO1      VERSION=1
         PZE      *R5
         DO1      VERSION=2
         DATA     0
         USECT    PRTERR
         AI,R1    -1                PRINTED ALL MESSAGES
         BNEZ     PRTERR1           NO
         PAGE
PRTERR2  EQU      %                 CHECK FOR I/O ERROR
         DO       VERSION=1
         B        INITBUF
         ELSE
         LW,R1    IOERR,R7          I/O ERROR PRESENT
         BEZ      PRTERR3           NO-PRINT SEVARITY LEVEL
         LB,R2    R1                SAVE I/O ERROR CODE
         SLS,R1   -17               SHIFT OVER SUBCODE
         AND,R1   =X'7F'            ISOLATE SUBCODE
         LI,R3    2
         STB,R2   R1,R3             PUT BACK ERROR CODE
         LI,R2    3
         STB,R2   R1                MAKE ERROR FILE KEY
         STW,R1   IOERR,R7
         LI,R3    IOERR
         AW,R3    R7                ADDRESS OF KEY
         CAL1,1   FPTSETIO          SER ERR AND ABN ADDRESSES
         USECT    PLSECT
FPTSETIO GEN,8,7,17    X'06',0,M:EI
         DATA     X'C0000000'
         DATA     ABNIOERR
         DATA     ABNIOERR
         USECT    PRTERR
         CAL1,1   FPTIOER           READ ERROR FILE FOR I/O ERROR MESS.
         USECT    PLSECT
FPTIOER  GEN,8,7,17      X'10',0,M:EI
         DATA     X'F8000010'
         DATA     ABNIOERR
         DATA     ABNIOERR          ABNORMAL
         PZE      *R6               BUFFER
         DATA     80                SIZE
         PZE      *R3               KEY
         USECT    PRTERR
         LW,R3    M:EI+4
         SLS,R3   -17
         MTW,0    J:JIT             ONLINE MODE
         BLZ      %+2               YES
         AI,R3    -1                REMOVE NL CHAR GOING TO PRINTER
         CAL1,1   FPTMESS           PRINT I/O ERROR MESSAGE
         FIN
PRTERR3  BAL,SR4  CLOSEI            GO-CLOSE M:EI
         B        RETURN
INITBUF  LCI      4
         LM,R1    CONST
         STM,R1   PRTBUF,R7         MOVE MESSAGE TO PRINT BUFFER
*
         LW,R1    IOERR,R7
         LB,R1    R1                GET I/O ERROR CODE
         BEZ      RETURN
         DO       VERSION=2
         LW,R1    IOERR,R7
         SLS,R1   -8
         FIN
         BAL,SR4  HEX2BCD           CONVERT TO EBCDIC
         AND,R3   =X'4040FFFF'      PACK INTO MESSAGE
         STW,R3   PRTBUF+4,R7
         DO       VERSION=1
         LI,R3    20
         LI,R6    PRTBUF
         AW,R6    R7
         LI,R5    0
         ELSE
         LW,R1    IOERR,R7
         BAL,SR4  HEX2BCD
         SLS,R3   8
         AND,R3   =X'00FFFF00'
         OR,R3    =X'60000015'  INSERT NL CHAR
         STW,R3   PRTBUF+5,R7       INTO I/O ERROR LINE
         LI,R3    23                CHAR COUNT OF MESSAGE
         MTW,0    J:JIT             BATCH MODE
         BGEZ     %+2               YES
         LI,R3    24                NO-TYPE NL CHAR
         FIN
         CAL1,1   FPTMESS           PRINT I/O ERR MESSAGE
*
RETURN   LCI      7                 RESTORE REGISTERS
         PLM,R5   *R7
         B        *SR4
*
PRTERR5  MTW,0    COPYSTDF,R7       COPYSTD COMMAND
         BNEZ     PRT1+1            YES - GO PRINT ERROR MESSAGE
         LW,R1    CMBX,R7
         CI,R1    CONTINUE+CONTINUE+CONTINUE+CONTINUE
         BGE      PRT1+1            CONTINUED COMMAND
         B        PRTERR3           NOTHING TO PRINT
         PAGE
ABNPCLER LCI      4
         LM,SR1   TXPCLERR
         STM,SR1  PRTBUF,R7         PUT PCL ERROR CODE IN BUFFER
         LCI      2
         PSM,R1   *R7               SAVE ERROR MESSAGE KEY POINTERS
         LI,R1    X'FFFF'
         AND,R1   *R2
         DW,R1    =100              GET PCL DECIMAL ERROR CODE
         BAL,SR4  BIN2BCD           GO-CONVERT TO EBCDIC
         LCI      2
         PLM,R1   *R7               RESTORE ERROR MESSAGE KEY POINTERS
         SLS,R3   8
         AND,R3   =X'40FFFF00'
         OR,R3    =X'15'            INSERT NL CHAR
         STW,R3   PRTBUF+4,R7       PUT PCL ERROR CODE IN BUFFER
         LI,R3    19                CHAR COUNT OF MESSAGE
         MTW,0    J:JIT             BATCH MODE
         BGEZ     %+2               YES
         LI,R3    20                NO-TYPE NL CHAR
         B        PRTERR4
TXPCLERR TEXT     '  PCL ERROR CODE'
         PAGE
ABNIOERR EQU      %
         BAL,SR4  CLOSEI            GO-CLOSE M:EI
         B        INITBUF
*
CONST    EQU      %
         TEXT     ' ***** I/O ERROR'
         DO       VERSION=1
         PAGE
MSGADR   DATA     M1
         DATA     M2
         DATA     M3
         DATA     M4
         DATA     M5
         DATA     M6
         DATA     M7
         DATA     M8
         DATA     M9
         DATA     M10
         DATA     M11
         DATA     M12
         DATA     M13
         DATA     M14
         DATA     M15
         DATA     M16
         DATA     M17
         DATA     M18
         DATA     M19
         DATA     M20
         DATA     M21
         DATA     M22
         DATA     M23
         DATA     M24
         DATA     M25
         DATA     M26
         DATA     M27
         DATA     M28
         DATA     M29
         DATA     M30
         DATA     M31
         DATA     M32
         DATA     M33
         DATA     M34
         DATA     M35
         DATA     M36
         DATA     M37
         DATA     M38
         DATA     M39
         DATA     M40
         DATA     M41
         DATA     M42
         DATA     M43
         DATA     M44
         DATA     M45
         DATA     M46
         DATA     M47
         DATA     M48
         DATA     M49
         DATA     M50
         DATA     M51
         DATA     M52
         DATA     M53
         DATA     M54
         DATA     M55
         DATA     M56
*
* THE FOLLOWING TABLE MATCHES THE UTS ERRMSG FILE
M1       TEXTC    'ARGUMENT GREATER THAN 31 CHARACTERS'
M2       TEXTC    'ILLEGAL DEVICE CODE'
M3       TEXTC    'INVALID REEL NUMBER SPECIFICATION'
M4       TEXTC    'ILLEGAL FILE NAME SPECIFICATION'
M5       TEXTC    'ILLEGAL ACCOUNT NUMBER SPECIFICATION'
M6       TEXTC    'ILLEGAL PASSWORD SPECIFICATION'
M7       TEXTC    'TOO MANY FIELDS IN A FILE IDENTIFICATION SPEC',;
                  'IFICATION'
M8       TEXTC    'INVALID FILE RANGE SPECIFICATION'
M9       TEXTC    'MORE THAN TEN RS FIELDS FOR AN INPUT DEVICE'
M10      TEXTC    'OVERFLOW ON A RS VALUE'
M11      TEXTC    'ERROR ON Y VALUE OF RS OPTION'
M12      TEXTC    'CS ID-FIELD GREATER THAN FOUR CHARACTERS'
M13      TEXTC    'ERROR ON N OR K VALUE OF CS OPTION'
M14      TEXTC    'IMPROPER TERMINATION WITHIN RS, LN, OR CS OPTION'
M15      TEXTC    ')) MUST TERMINATE RS, LN, OR CS OPTION'
M16      TEXTC    'SPECIAL ARGUMENTS MUST HAVE ) AS TERMINATION CHAR',;
                  'ACTER'
M17      TEXTC    'EH?'
M18      TEXTC    'UNDEFINED COMMAND'
M19      TEXTC    'ILLEGAL INPUT DEVICE'
M20      TEXTC    'NO DEFINED OUTPUT DEVICE'
M21      TEXTC    'ILLEGAL OUTPUT DEVICE'
M22      TEXTC    'REEL NUMBER SPECIFICATION NOT VALID FOR THIS DEVICE'
M23      TEXTC    'FILE SPECIFICATION NOT VALID FOR THIS DEVICE'
M24      TEXTC    'DATA CODE SPECIFICATION NOT VALID FOR THIS DEVICE'
M25      TEXTC    'MODE SPECIFICATION NOT VALID FOR THIS DEVICE'
M26      TEXTC    'SEQUENCE SPECIFICATION NOT VALID FOR THIS DEVICE'
M27      TEXTC    'RECORD SELECTION SPECIFICATION NOT VALID FOR THIS ',;
                  'DEVICE'
M28      TEXTC    'PK/BIN/7T COMBINATION NOT VALID'
M29      TEXTC    'NULL ARGUMENT (TWO DELIMITERS IN A ROW)'
M30      TEXTC    'IMPROPER TERMINATION OF THE COMMAND'
M31      TEXTC    'ONE REEL NUMBER MUST BE SPECIFIED ON THIS COMMAND'
M32      TEXTC    '''TO'' OR ''OVER'' NOT SPECIFIED'
M33      TEXTC    'RECORD SIZE EXCEEDS AVAILABLE MEMORY'
M34      TEXTC    'INVALID DEVICE TYPE FOR THIS COMMAND'
M35      TEXTC    'TOO MANY REEL NUMBERS SPECIFIED'
M36      TEXTC    'OVERFLOW ON NUMBER OF FILES ON ''SPF'' COMMAND'
M37      TEXTC    'INVALID DIRECTION INDICATOR ON ''SPF'' COMMAND'
M38      TEXTC    'INPUT RECORD SIZE LARGER THAN 32767 BYTES'
M39      TEXTC    'INVALID OPTION FOR COPYALL'
M40      TEXTC    'ACCOUNT SPECIFICATION NOT VALID ON ''SPE'' COMMAND'
M41      TEXTC    'RS SPECIFICATION BEYOND END OF FILE'
M42      TEXTC    'ERROR IN COMPRESSED INPUT'
M43      TEXTC    'C OPTION INVALID ON BOTH INPUT AND OUTPUT'
M44      TEXTC    'RECORD SELECTION INVALID WITH C OPTION'
M45      TEXTC    'INVALID TAB SPECIFICATION'
M46      TEXTC    'OVERFLOW ON EDIT LINE NUMBER'
M47      TEXTC    'ZERO INCREMENT ON CS OR LN OPTION'
M48      TEXTC    'TX OPTION USED WITHOUT TABS COMMAND'
M49      TEXTC    'INVALID OPTION FOR COPYSTD'
M50      TEXTC    'MORE THAN EIGHT READ OR WRITE ACCOUNTS'
M51      TEXTC    'MORE THAN 16 TAB VALUES'
M53      TEXTC    'TOO MANY CHARACTERS IN THE COMMAND'
M54      TEXTC    'INVALID VALUE FOR ANS OPTION'
M55      TEXTC    'FORMAT CODE INVALID FOR COMMAND'
M56      TEXTC    'INVALID OPTION FOR ANS TO ANS COPY'
         FIN
         END

