*                 CATALOG NO. 704963 - SIGMA 5/7 BPM M:DELPRI
*  SAM KEYS C00 UPDATES
         SYSTEM   UTS
         DEF      DELPRI,DELPRISZ
         CSECT    0
DELPRI   EQU      %
         PAGE
*
*                             PROGRAM NAME - BATCH MONITOR.
*
         PAGE
*                 SYMBOLIC REGISTER DEFINITIONS.
R0       EQU      0
R2       EQU      2
R3       EQU      3
R7       EQU      7
SR1      EQU      8
SR2      EQU      9
SR4      EQU      11
         PAGE
*ROUTINE TO DELETE FILE(S) FROM THE FILE DIRECTORY(SYMFILE) AND DISC
*ENTERED BY KEY-IN ROUTINE BECAUSE OF UNSOLICITED KEY-IN OF THE FORM:
*!DELETE SYSTEMID(NL) (DELETE ALL FILES WITH THE KEY-IN SYSTEMID) OR
*!DELETE SYSTEMID,YYNDD(NL) (DELETE DEVICE YYNDD FILE WITH SYSTEMID)
*(R7)=KEY-IN PARAMETER LIST ADDRESS
*(SR1)=CURRENT KEY-IN MESSAGE CHARACTER
*        B        KIDEL
         REF      Y001,KEYINR
         DEF      KIDEL
KIDEL    EQU      %
         LI,12    KDELGFC           GHOST CODE
         LI,SR4   KSGCQ             GET INFO - TELL GHOST
         B        DPSCAN
*
         REF      KSGCQ
         PAGE
*ROUTINE TO CHANGE THE PRIORITY OF A FILE IN THE DIRECTORY(SYMFILE)
*ENTERED BY KEY-IN ROUTINE BECAUSE OF UNSOLICITED KEY-IN OF THE FORM:
*!PRIORITY SYSTEMID,YYNDD,NEWPRIORITY
*(R7)=KEY-IN PARAMETER LIST ADDRESS
*(SR1)=CURRENT KEY-IN MESSAGE CHARACTER
*        B        KIPRI
         DEF      KIPRI
KIPRI    EQU      %
         BAL,SR4  DPSCAN            GET SYSID AND DCTX
         CI,SR1   ','               COMMA DELIMITER FOUND
         BNE      KEYERR            NO,ERROR
         BAL,SR4  GKIFLD            YES,GET PRIORITY
         MTW,-1   KFL,R7            ONE CHARACTER PRIORITY
         BNEZ     KEYERR            NO,ERROR
         LW,14    KPLB,R7           GET PRIO
         LB,14    14                ONE CHAR
         AI,14    -'0'              CONVERT AND CHECK
         BGEZ     %+3
         AI,14    '0'-'A'+10
         BLEZ     KEYERR
         CI,14    X'F'
         BG       KEYERR
         LI,12    PRIOGFC
         B        KSGCQ
*
         REF      PRIOGFC,KDELGFC
         REF      RBLIMS,DCT4
         PAGE
*ROUTINE TO GET SYSTEM IDENT AND DCT INDEX FROM DELETE OR PRIORITY
*KEY-IN MESSAGE
*(R7)=KEY-IN PARAMETER LIST ADDRESS
*(SR1)=CURRENT KEY-IN FIELD DELIMITER
*        BAL,SR4  DPSCAN
         REF      DEVCK
         REF      KFL,KPLB
         REF      GKIFLD,KEYERR,CVSYSID,NXKICHR
DPSCAN   EQU      %
         CI,SR1   X'40'             SPACE DELIMITER FOUND BY KEYIN
         BNE      KEYERR            NO,ERROR EXIT
         PUSH     SR4               YES,SAVE EXIT
         BAL,SR4  GKIFLD            GET SYSID
         BAL,SR4  CVSYSID           CONVERT SYSID FROM HEX TO BINARY
         LW,13    R2
         BCR,8    DPS01             SYSID VALID,IF YES,BRANCH
DPS00    PULL     SR4               NO,RESTORE EXIT
         B        KEYERR            ERROR EXIT
         BAL,SR4  NXKICHR           GET NEXT DELIMITER
DPS01    CI,SR1   ' '               SPACE DELIMITER
         BE       %-2               YES,TRY AGAIN
         CI,SR1   X'15'             NO,NEW LINE DELIMITER
         BE       DPS03             YES
         CI,SR1   ','               NO,COMMA DELIMITER
         BNE      DPS00             NO,ERROR
         BAL,SR4  GKIFLD            GET DEVICE YYNDD
         MTW,-5   KFL,R7            'YYNDD' LENGTH CORRECT
         BNEZ     DPS00             NO,ERROR
         LW,R2    KPLB,R7           YES,GET 'YYND'
         LW,R3    KPLB+1,R7         GET 'D   '
         BAL,SR4  DEVCK             CONVERT 'YYNDD' TO DEVICE DCTX
         BCS,8    DPS00             LEGAL DEVICE,IF NO,BRANCH
         CLM,R2   RBLIMS
         BCR,9    DPS00
         LB,R2    DCT4,R2
         STB,R2   13
         B        DPS02B            CONTINUE
DPS02A   BAL,SR4  NXKICHR           GET NEXT DELIMITER
DPS02B   CI,SR1   ' '               SPACE
         BE       DPS02A            YES,TRY AGAIN
DPS03    PULL     SR4               NO,RESTORE EXIT
         B        *SR4              EXIT
         PAGE
         DEF      KFRMCG
         REF      KFCGFC
*
KFRMCG   EQU      %
         BAL,11   DPSCAN
         LI,14    0
         CI,8     ','
         BNE      KIF1
         BAL,11   GKIFLD
         MTW,-4   KFL,7
         BGZ      KEYERR
         LW,14    KPLB,7
KIF1     EQU      %
         LI,12    KFCGFC
         B        KSGCQ
DELPRISZ  EQU   %-DELPRI
         END

