**********************************************************************
*M* RATLER CENTRALIZED PROCESSOR FOR REMOTE FILE ACCESS
**********************************************************************
*P*      NAME:    RATLER
*,*      PURPOSE: RATLER PROCESSES ALL SERVICE REQUESTS FROM REMOTE
*,*               ISCL'S THROUGH FILE BLOCKING,TRANSMISSION, AND RE-
*,*               CONSTRUCTION, FILE EXAMINATION, AND FILE DELETION.
*,*      DESCRIPTION:  RATLER BEST FUNCTIONS AS A SYSTEM GHOST AND MUST
*,*               BEGIN WITH AT LEAST B0-PRIVILEGE.
*,*                    WHEN RATLER FIRST STARTS UP, HE INITIALIZES HIM-
*,*               SELF FOR JIT ACCESS, EXIT CONTROL, AND A LOWER BASE
*,*               PRIORITY FOR EXECUTION. RATLER ACQUIRES JIT ACCESS BY
*,*               MODIFYING J:JAC THROUGH A SAD CAL, THE SAME MANNER
*,*               IN WHICH THE LOWER BASE PRIORITY IS OBTAINED.
*,*               OTHER INTIALIZATION INVOLVES DETERMINING THE EXTENT
*,*               OF AVAILABLE MEMORY AND ADJUSTING DCBS.
*,*                    ONCE READY, RATLER COMMENCES THE PROCESSING CYCLE.
*,*               THE 'RATL' FILE IN :SYS IS READ FOR THE WORKSTATION
*,*               NAME FOR PROCESSING AND THE LDEV PROCESSOR IS
*,*               LINKED TO, TO CONNECT FOUR COOP STREAMS TO THE DEVICES
*,*               'FI' AND 'FO', WITH AND WITHOUT FORM NAMES.
*,*                    RATLER READS A SERVICE REQUEST AND ENTERS THE
*,*               APPROPRIATE COMMAND PROCESSOR (SEND,LIST OF DELETE).
*,*               ALL MESSAGES PRODUCED ARE WRITTEN OUT AT THE COMPLE-
*,*               TION OF THAT COMMAND THROUGH 'FO'.
*,*                    WHEN ALL SERVICE REQUESTS FOR THAT PARTICULAR
*,*               WORKSTATION HAVE BEEN EXHAUSTED, RATLER READS THE
*,*               'FI' DEVICE FOR UNNAMED MESSAGE FILES ( THE
*,*               TRANSMITTED BLOCKED FILES FROM THAT WORKSTATION ).
*,*               EACH FILE IS RECONSTRUCTED AND A MESSAGE IS WRITTEN
*,*               IN THE MAILBOX FILE OF THE USER THAT REQUESTED
*,*               SERVICE. AFTER ALL FILES HAVE BEEN RECONSTRUCTED,
*,*               RATLER RE-ENTERS THE PROCESSING CYCLE TO PICK UP THE
*,*               NEXT WROKSTATION.
*,*                    WHEN THERE ISNT ANOTHER WORKSTATION, RATLER
*,*               WILL SLEEP FOR FIVE MINUTES, AT WHICH POINT HE
*,*               WILL AWAKE AND BEGIN READING THE 'RATL' FILE FROM
*,*               THE FIRST RECORD.
*,*      REFERENCE:  ISCL/RATLER EXTERNAL AND INTERNAL SPECIFICATIONS,
*,*               REMOTE PROCESSING MANUAL, AND CORRESPONDING ISCL
*,*               REPORTS.
         SYSTEM   UTS
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * *
*      E Q U I V A L E N C E 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
R8       EQU      8
R9       EQU      9
R10      EQU      10
R11      EQU      11
R12      EQU      12
R13      EQU      13
R14      EQU      14
R15      EQU      15
PSWDDISP EQU      X'6'              RELATIVE LOC. OF PASSWORD IN :USERS
SNDBIT   EQU      X'1'
LSTBIT   EQU      X'2'
DELBIT   EQU      X'4'
OVRBIT   EQU      X'2'
RVRSBIT  EQU      X'4'
LEABIT   EQU      X'4'
RDACBIT  EQU      X'10'
WRACBIT  EQU      X'20'
WSNBIT   EQU      X'40'
LABIT    EQU      X'80'
LASTBIT  EQU      X'80'
EXPBIT   EQU      X'100'
LVLP     EQU      X'10000'
ACTBIT   EQU      X'8'
PWDBIT   EQU      X'200'
NXTFBIT  EQU      X'400'
FLEBIT   EQU      X'1000'
INOUT    EQU      X'4'
IN       EQU      X'1'
CONSEC   EQU      1
OUT      EQU      2
RANDOM   EQU      3
KEYED    EQU      X'2'
SEQUEN   EQU      1
RECSIZ   EQU      X'78'
SPACE    EQU      X'40'
TAB      EQU      X'05'
COMMA    EQU      X'6B'
FRPRIV   EQU      X'C0'             => X'C0'
FMPRIV   EQU      X'B0'             < X'C0'
FOREVER  EQU      X'7FFF'
MINUTE   EQU      50
PBITS    EQU      RDACBIT+WRACBIT+EXPBIT+PWDBIT+;
                  ACTBIT+NXTFBIT
JJIT     EQU      X'8C00'
VPA      EQU      X'10000'
V:JAC    EQU      VPA+J:JAC-J:JIT
DISP     EQU      30-2*(JJIT&X'1E00')**-9
* * * * * * * * * * * * * * * * * * * *
*      D E F I N I T I O N S    A N D   R E F E R E N C E S     *
*
         DEF      RAP               RELATIVE ZERO FOR PROCEDURE PATCHING
         DEF      RAD               RELATIVE ZERO FOR DATA PATCHING
         DEF      RATCH             PATCH AREA : 50 WORDS
         DEF      SLEEP
         REF      M:LO
         REF      M:SI              INPUT : READ REMOTE DEVICES
         REF      M:EI              INPUT : READ LOCAL FILES
         REF      M:EO              OUTPUT : WRITE MESSAGES TO REMOTE
*,*                                 DEVICES ( OR BLOCKED FILES)
         REF      M:SO              INPUT : READ 'RATL' FILE
         REF      M:SL              INPUT : READ :USERS FILE
         REF      M:DO              INPUT : ERRMSGE DCB FOR READING
*,*                                 THE ERRMSG FILE
         REF      J:JIT             INPUT : USER ID AND MODE (B,G,O)
         REF      J:ACCN            IN/OUT : USER ACCOUNT
         REF      J:UNAME           IN/OUT : USER NAME
         REF      JX:CMAP           INPUT : PHYSICAL PAGE # OF JIT
         REF      JB:PRIV           IN/OUT : CHANGE OF RUNNING PRIVI-
*,*                                 LEGE TO CONTROL FILE ACCESS
         REF      JB:TDP            INPUT : TOP OF DYNAMIC DATA
         REF      J:CCBUF           OUTPUT : CMD STRING FOR ISCL
         REF      J:NRS             INPUT : CURRENT # OF INSWAPS
         REF      J:JAC             OUTPUT : ACCESS TO JIT IS CHANGED
         REF      UB:PRIOB          OUTPUT : LOWER PRIORITY FOR EXECUTION
         REF      MAILBOX           ROUTINE FOR WRITING MAILBOX MESSAGES
         REF      ERRMSGE           ROUTINE FOR READING ERRMSG FILE
         REF      NOPRINT           OUTPUT : USED TO SUPPRESS LISTING
*,*                                 OF MAILBOX MESSAGES
* * * * * * * * * * * * * * * * * * * *
*        P R O C E D U R E S          *
* * * * * * * * * * * * * * * * * * * *
BYTE     CNAME
         PROC
         DATA,1   AF-SLP:
         ERROR,4,AF-SLP:>255 'ARG TOO LARGE'
         PEND
* * * * * * * * * * * * * * * * * * * *
RAP      CSECT    1                 PROCEDURE
RAD      CSECT    0                 DATA
         SYSTEM   BPM
         USECT    RAP
         LC       J:JIT             WILL RUN ONLY IN GHOST MODE.
         BCS,4    %+2               IF ANY OTHER MODE, JUST EXIT.
         M:EXIT
         INT,R7   J:JIT
         SLS,R7   -1
         AI,R7    UB:PRIOB
         AND,R7   X1FE00
         LI,R2    UB:PRIOB
         SW,R2    R7
         CAL1,8   SAD               MAP VPA ONTO UB:PRIOB TO
         BCR,8    %+2               CHANGE PRIORITY BASE.
         M:XXX
         AI,R2    VPA
         INT,R1   J:JIT
         MTB,-4   *R2,R1
         LI,R1    JJIT**-13
         LW,R2    J:JAC,R1          GET WORD WITH JIT ACCESS FLAGS
         AND,R2   MPJAC             AND RESET ACCESS ON JIT PAGE.
MSTORE   EQU      %
,FVPA    M:FVP    VPA
         INT,R9   J:NRS
         LI,R7    JJIT**-9
         LOAD,R7  JX:CMAP,R7        IF WE'RE SWAPPED, THEN WE
         SLS,R7   9
,SAD     M:CVM    *R7,VPA           MUST HAVE MISSED THE JIT: SO
         CW,R9    J:NRS             TRY AGAIN.
         BNE      MSTORE
         STW,R2   V:JAC,R1
         CW,R9    J:NRS
         BNE      MSTORE            IF AT FIRST YOU DONT SUCCEED ..
         CAL1,8   FVPA              FREE THE PAGE WE USED FOR SADING
         LI,R11   2                 AND NOW GET SCHEDULED AND
         BAL,R6   WAIT              PRESTO, WE CAN STORE INTO OUR JIT.
         LI,R0    FRPRIV             CAN WE ??
         STB,R0   JB:PRIV
,XCTL    M:XCON   XCON
         LI,R0    1
         STW,R0   NOPRINT           NON-ZERO MEANS MAILBOX MESSAGES
         BAL,R15  MMINIT            DONT GET PRINTED ON LO
         CAL1,1   ADJUST            SET UP M:SL FOR :USERS
         CAL1,1   ADJUSTEI          SET UP M:EI FOR ABN,ERR,FILENAME=0
         B        RASO               > RASO > RANWSN
RANWSN   EQU      %
         M:OPEN   M:SO,(FILE,'RATL',':SYS'),(CONSEC),(IN),;
                  (ABN,RATLERR),(SEQUEN),(SAVE),(ERR,RATLERR)
,PRECORD M:PRECORD M:SO,(N,0)       WE KEEP TRACK OF WHERE WE ARE IN
WSNPOS   EQU      PRECORD+2         'RATL' FILE BY POSITIONING IT BEFORE
         MTW,1    WSNPOS            READING. WHEN WE REACH THE END, THE
         LW,R1    BLANK             POSITION IS RE-INITIALIZED.
         STD,R1   WSNBUF
         M:READ   M:SO,(BUF,WSNBUF),(SIZE,8),(BTD,0),(WAIT),;
                  (ERR,RATLERR),(ABN,RATLERR)
,CLSSO   M:CLOSE  M:SO,(SAVE)
         BAL,R15  OILDEV
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*F*      NAME:    RANMFIL
*,*      PURPOSE: RANMFIL READS AND PROCESSES ALL SERVICE REQUESTS.
*,*      DESCRIPTION:  RANMFIL OPENS M:SI TO A STREAM, CONNECTED TO
*,*               THE DEVICE 'FI' WITH THE FORM NAME 'ISCL', AND READS
*,*               120-BYTE CHUNKS UNTIL THE ENTIRE LOGICAL RECORD
*,*               HAS BEEN INPUT.
*,*                    AFTER READING THE RECORD (CONSTITUTING THE
*,*               ENTIRE FILE), THE :USERS FILE IS CHECKED FOR THE
*,*               USER'S AUTHORIZATION. THE TYPE OF COMMAND IS
*,*               DETERMINED ( SEE ISCL/RATLER INTERNAL SPECIFICATION
*,*               FOR FORMAT OF RECORD ) AND THE CORRESPONDING ROUTINE
*,*               IS ENTERED .
RANMFIL  EQU      %                 NEED C0 FOR READING :USERS
         LI,R1    FRPRIV
         STB,R1   JB:PRIV
         M:OPEN   M:SI,(DEVICE,'L3'),(ERR,SIERR),(ABN,SIERR),(IN),;
                  (BTD,0)
         LI,R13   NRCONT
NRUR     EQU      %
         LI,R0    0
         STW,R0   NRECCNT           INITIALIZE PHYSICAL RECORD COUNT
         LI,R7    1
         BAL,R15  MMGD              GET ONE DYNAMIC DATA PAGE
         B        NOGO
         SLS,R8   11
         LW,R1    R9
         AI,R9    6                 INITIALIZE PRIMARY FLAGS POINTER
         STW,R9   PSIGLOC           AND CURRENT FLAGS POINTER
         STW,R9   SIGLOC
,FPTREAD  M:READ  M:SI,(BUF,*R1),(SIZE,RECSIZ),(WAIT)
         MTW,1    FCOUNT            GOT A FILE
NR1      EQU      %                 IF PHYSICAL RECORD HEADER IS NEGA-
         LW,R0    0,R1              TIVE THEN THIS IS LAST PHYSICAL
NR:LP    EQU      %                 RECORD.
         CW,R0    Y8
         BANZ     NREAD1
         CW,R0    NRECCNT           IF PHYSICAL RECORD STILL IN SEQUENCE
         BE       %+2               CONTINUE READING. OTHERWISE LOG
         B        NRCNTERR          ERROR AND RESTART.
         MTW,1    NRECCNT
         AI,R1    (RECSIZ-4)**-2
         AI,R8    -RECSIZ
         BGE      %+6
         LW,R3    R1                CHECK FOR END OF PAGE.
         BAL,R6   PAGEND
         B        NGENDSET          YES, AND CANT GET NUTHER.
         NOP      0
         LW,R1    R3
         LW,R0    0,R1              PICK UP PHYS HDR AND LEAVE
         CAL1,1   FPTREAD           RECORD CONTINUOUS. STILL
         XW,R0    0,R1              READING..
         B        NR:LP
NREAD1   EQU      %
         EOR,R0   Y8
         CW,R0    NRECCNT
         BE       %+2
         B        NRCNTERR
         CI,R13   RAUFIL            IF READING AN UNNAMED FILE,
         BG       %+2               KEEP DCB OPEN.
,CLSSI   M:CLOSE  M:SI,(REL)
         LH,R0    M:SI+4
         SLS,R0   -1
         SLS,R1   2
         AW,R0    R1                COMPUTE END OF RECORD
         STW,R0   SIGEND
         CI,R13   RAU1              IF NOT READING FIRST RECORD OF AN
         BG       NREAD2            UNNAMED FILE AND NOT READING A
         LW,R6    PSIGLOC           NAMED FILE, SKIP AUTH. CHECK
         AI,R6    -5
         LW,R0    0,R6
         LW,R1    1,R6
         STW,R0   J:ACCN            SET SELF UP AS USER
         STW,R1   J:ACCN+1
         LI,R7    1                 GET ONE PAGE FOR LOGON RECORD
         BAL,R15  MMG
         B        NGENDSET
         SLS,R8   11                SET SIZE OF BUFFER
         BAL,R15  CHK%USER          CHECK USER'S AUTH. HERE
NREAD2   EQU      %
         LI,R1    FMPRIV            ESTABLISH FILE MNGMNT. PRIVILEGE
         STB,R1   JB:PRIV
         B        *R13
NRCONT   EQU      %
         LI,R2    3
         LB,R2    *PSIGLOC,R2       COMMAND BYTE
         LI,R3    NRCMDS            IF COMMAND BIT IS FOUND, GO TO
NRCMDLP  EQU      %                 NRCMDFD, ELSE MUST BE MAILBOX
         CB,R2    CMDTBL,R3         MESSAGES.
         BANZ     NRCMDFD
         BDR,R3   NRCMDLP
* * * * * * * * * * * * * * * * * * * *
         CAL1,1   OPEO1             OPEN OUTPUT TO NAMED STREAM.
         LI,R1    FRPRIV            NEED 'C0' POSSIBLY TO WRITE
         STB,R1   JB:PRIV           MAILBOX MESSAGES.
         LI,R3    1
         LB,R15   *PSIGLOC,R3       COUNT OF MESSAGES
         BEZ      MAILDONE
         LW,R2    PSIGLOC
         LW,R4    J:ACCN            TARGET ACCOUNT.
         LW,R5    J:ACCN+1
         STD,R4   MAILACCT
         LD,R4    RATLNAME
         STW,R4   J:ACCN
         STW,R5   J:ACCN+1
         AI,R2    1
         LI,R10   MAIL
MAILLOOP EQU      %
         STW,R2   *R10
         BAL,R11  MAILBOX
         LB,R1    *R2               FIND NEXT TEXTC MESSAGE.
         AI,R1    4
         SLS,R1   -2
         AW,R2    R1
         BDR,R15  MAILLOOP
MAILDONE EQU      %
         LI,R1    FMPRIV            RESTORE NORMAL PRIVILEGE.
         STB,R1   JB:PRIV
         B        XCMPLT            THROUGH WITH THIS COMMAND TEXT.
* * * * * * * * * * * * * * * * * *
NRCMDFD  EQU      %                 IF COMMAND IS A SEND, USE
         CI,R3    3                 UNNAMED STREAM ( FOR PASSING
         BNE      %+3               THE FILE(S) ) ELSE USE NAMED
,OPEO3   M:OPEN   M:EO,(DEVICE,'L4') STREAM.
         B        %+2
,OPEO1   M:OPEN   M:EO,(DEVICE,'L2')
         LW,R7    TESTBIT           DEFAULT IS A TEST OPEN.
         STS,R7   TRGTOPEN
NRCMDF1  EQU      %
         LW,R9    SIGEND            THE DYNAMIC DATA FOLLOWING
         AI,R9    27                THE COMMAND FILE IS USED TO
         SLS,R9   -2                FORM MESSAGES TO BE PASSED
         STW,R9   SLDBGN            BACK TO THE USER. THE FIRST
         LI,R7    0                 SIX AND 3/4 WDS ARE SKIPPED
         STW,R7   *R9               TO GUARANTEE ROOM FOR THE
         AI,R9    1                 ACCOUNT,NAME AND PHYS REC
         SLS,R9   2                 HDR.
         STW,R9   SLDPTR
         B        CMDRTN,R3
* * * * * * * * * * * * * * * * * * * * * * * * * *
CHK%USER EQU      %
         LW,R4    CURDADR           IF 'RATLER  ', THEN DONT DO THE
         LW,R2    3,R4              AUTHORIZATION CHECK. ( S.O. )
         LW,R3    4,R4
         CD,R2    RATLNAME
         BE       *R15
         LI,R4    SPACE             FORMULATE THE :USERS KEY FOR
         LW,R3    CHKM1             THIS USER. KEY CONSISTS OF :
         LW,R2    CURDADR            'ACCOUNT' + 1 BLANK + 'NAME'
         AI,R2    1                 ALL IN TEXTC FORMAT. ALSO
         SLS,R2   2                 ACCOUNT AND NAME SUPPRESS
         MBS,R2   0                 TRAILING BLANKS.
         AI,R3    -1
         LI,R11   12
         CB,R4    0,R3
         BNE      %+2
         BDR,R3   %-2
         AI,R3    1
         STB,R11  R3
         STB,R4   0,R3
         AI,R3    1
         MBS,R2   0
         AI,R3    -1
         CB,R4    0,R3
         BNE      %+2
         BDR,R3   %-2
         AI,R3    -BA(KEYBUF)
         STB,R3   KEYBUF
         LI,R11   MINUTE            WAIT ONE MINUTE IF FILE BUSY.
USERCHK  EQU      %
         M:READ   M:SL,(KEY,KEYBUF),(WAIT),(ERR,LOGERR),;
                  (ABN,LOGERR),(SIZE,*R8),(BUF,*R9)
,CLOSELOG M:CLOSE M:SL,(SAVE)
         LI,R3    PSWDDISP          IF PASSWORD IS SPECIFIED IN
         LW,R3    *R9,R3            RECORD, DONT ALLOW USER ACCESS.
         BNEZ     CHK˛MATE
         B        *R15
* * * * * * * * * * * * * * * * * * * *
         LI,R11   MINUTE
LOGERR   EQU      %
         BAL,R6   CHK%WAIT
         B        USERCHK
         B        %-3
* * * * * * * * * * * * * * * * * * * *
CHK˛MATE EQU      %
         LW,R2    Y002              CLOSE :USERS IF OPEN.
         CW,R2    M:SL
         BAZ      %+2
         CAL1,1   CLOSELOG
         LI,R1    FMPRIV            RESET PRIVILEGE.
         STB,R1   JB:PRIV
         CI,R13   RAUFIL            IF UNNAMED FILE READ, TRASH
         BL       %+2               THIS FILE AND READ ANOTHER.
         B        SUERR1
         CAL1,1   OPEO1             OUTPUT STREAM TO BE USED.
         LI,R13   RANMFIL           SET UP RETURN.
         LI,R2    3                 IF THIS IS A MAILBOX MESSAGE,
         LB,R2    *PSIGLOC,R2       DONT INFORM THE USER.
         BEZ      XCMPLT+3
         LI,R3    X'10000'          WILL OUTPUT ONE MESSAGE.
         STW,R3   *PSIGLOC          MOVE IN MESSAGE IN TEXTC.
         LI,R2    BA(NOTLIGIT)
         LI,R5    21
         LW,R3    PSIGLOC
         AI,R3    1
         SLS,R3   2
         STB,R5   R3
         MBS,R2   0
         AI,R5    24                FIVE WDS FOR ACCT,NAME
         LW,R7    PSIGLOC           ONE FOR CNT OF MESSAGES
         AI,R7    -5
         BAL,R15  XWRITE            WRITE FILE.
         BAL,R13  XCMPLT+1          SUPERCLOSE STREAM AND CLOSE DCBS.
         LI,R15   RANMFIL           RELEASE DYNAMIC DATA AND REREAD.
         B        MMFDALL
* * * * * * * * * * * * * * * * * * * *
CHK%WAIT EQU      %
         LH,R0    R10               IS ERR CODE THE BUSY CODE ??
         CI,R0    X'1402'
         BNE      2,R6
         BDR,R11  WAIT              BIAS OUR WAIT AS WE WAIT MORE.
         B        1,R6              WELL THAT DIDNT WORK ..
WAIT     EQU      %
         M:WAIT   *R11
         B        0,R6
* * * * * * * * * * * * * * * * * * * * * * * * * *
*F*      NAME:    DELETE
*,*      PURPOSE: DELETE PROCESSES THE DELETE COMMAND.
*,*      DESCRIPTION:  IF ALL GOES WELL, DELETE OPENS EACH FILE
*,*               SPECIFIED AND RELEASES IT. WHENEVER AND WHEREVER
*,*               AN ERROR OCCURS, THE ERROR CONDITION IS NOTED
*,*               FOR THE USER AND PROCESSING IS RESUMED.
*,*                    UPON COMPLETION OF PROCESSING, THE ACCUM-
*,*               ULATED MESSAGES ARE WRITTEN AND COMMAND CHAINING
*,*               IS CHECKED. IN EITHER CASE WE DEPART PROCESSING
*,*               ANOTHER COMMAND OR READING ANOTHER FILE.
DELETE   EQU      %
         LI,R7    0
         STW,R7   LNFILES
DELCONT  EQU      %
         LI,R7    INOUT
         LI,R6    PASSOPEN
         LI,R4    SEQUEN
         LW,R5    SIGLOC
         BAL,R15  OPEN
,CLSREL  M:CLOSE  M:EI,(REL)
         MTW,1    LNFILES
DELEND   EQU      %
         BAL,R15  SIGSWTCH
         B        SLDEND
         B        DELCONT
SLDEND   EQU      %
         LI,R10   NFILD+1
         LW,R5    LNFILES           IF 0 FILES CHANGED, SUPPRESS
         BNEZ     %+3               MESSAGE.
         LW,R11   SLDPTR
         B        SLDEND1
         LI,R6    4                 ADD MESSAGE TO DYN DATA.
         BAL,R11  LPG1
         LI,R4    1
         AI,R10   -1
         BAL,R9   LSTMBS
SLDEND1  EQU      %
         LW,R7    SLDBGN
         AI,R7    -5                SPACE BACK FOR ACCOUNT,NAME
         LW,R9    R7
         SLS,R9   2
         SW,R11   R9
         LW,R5    R11
         LI,R15   XCMPLT            XWRITE > XCMPLT > XCHKSIG
         B        XWRITE
XCHKSIG  EQU      %
         LI,R15   RANMFIL           SET UP EVENTUAL EXIT.
         LB,R5    *PSIGLOC          IF NO CHAINING (BYTE ZERO
         BEZ      MMFDALL           ZERO ) THEN RELEASE DYN DATA
         AW,R5    PSIGLOC           AND EXIT (REREAD).
         SLS,R5   2                 IF CHAINING EXTENDS BEYOND
         CW,R5    SIGEND            END-OF-FILE, FORGET IT.
         BGE      MMFDALL           ELSE, SET UP SIGNAL POINTERS
         SLS,R5   -2                AND CONTINUE WITH NEW COMMAND.
         STW,R5   SIGLOC
         STW,R5   PSIGLOC
         B        NRCONT
* * * * * * * * * * * * * * * * * * * *
*F*      NAME:    LIST
*,*      PURPOSE: LIST PROCESSES THE LIST COMMAND.
*,*      DESCRIPTION:  LIST SHARES A PATHWAY WITH THE SEND
*,*               LOGIC. THE TYPE OF LIST ( PLAIN, A, OR EA ,
*,*               OR EVEN .ACCT ) DETERMINES THE FILE
*,*               PARAMETER BRANCH VECTOR, WHEREUPON EACH
*,*               FILE IS OPENED AND THE FILE PARAMETERS EXAMINED
*,*               TO NOTE THE DESIRED ONES IN A MESSAGE, BEING
*,*               BUILT.
*,*                    WHEN ALL FILES HAVE BEEN OPENED, THE MESSAGES
*,*               ARE WRITTEN WITH ALL ERROR CONDITIONS ALSO BEING
*,*               REPORTED. THEN COMMAND CHAINING IS CHECKED,
*,*               WITH EXIT TO THE PROPER POINT ACCORDING TO THE
*,*               VERDICT OF THAT CHECK.
LIST     EQU      %
         LI,R7    0
         STW,R7   LNFILES
         STW,R7   LNGRAN
LST1     EQU      %
         LI,R6    0
         LW,R7    TESTBIT
         STS,R6   TRGTOPEN
         LW,R5    SIGLOC
         LW,R2    *SIGLOC           THE VARIOUS TYPES OF LIST
         CI,R2    FLEBIT
         BANZ     %+2
         CAL1,1   ADJUSTEI
         LI,R3    LEAB:VEC          CMDS ARE DIFFERENTIATED IN
         CI,R2    LEABIT            ORDER TO DETERMINE THE VLP
         BANZ     SLPPRY            VECTOR, AND THE CASE OF LISTING
         LI,R3    LAB:VEC           AN ACCOUNT IS ISOLATED TO
         CI,R2    LABIT             ZERO THE RESIDUAL FILENAME
         BANZ     SLPPRY            IN THE DCB.
         CI,R2    NXTFBIT
         BAZ      SLPPRY
         STS,R7   TRGTOPEN
         LI,R3    LALB:VEC
         B        SLPPRY
* * * * * * * * * * * * * * * * * * * *
*F*      NAME:    SEND
*,*      PURPOSE: SEND PROCESSES THE SEND COMMAND.
*,*      DESCRIPTION:  CONTRARY TO THE METHOD OF LIST, SEND
*,*               SWITCHES THE CORRENT SIGNAL POINTER (SIGLOC)
*,*               BEFORE ENTERING THE FILE PARAMETER LOGIC.
*,*               ( THIS IS DONE BECAUSE INDIVIDUAL FILES ARE IN-
*,*               DEPENDENT FOR LISTING, BUT NOT FOR SEND. IN THE
*,*               LATTER CASE, THE SOONER THE SECOND FILE IS OPENED
*,*               THE LESS TROUBLE ENCOUNTERED IF E.G. THE FILE
*,*               CANNOT BE ACCESSED, ETC. )
*,*                    THE FILE PARAMETER EXAMINATION IS THEN BEGUN,
*,*               LEAVING AT SLPORG, HAVING MOVED ALL RELEVANT
*,*               PARAMETERS INTO THE OPEN FPT BEING CONSTRUCTED
*,*               ( WHICH WILL BE TRANSMITTED AND USED AT THE REMOTE
*,*               SITE. )
*,*                    IF THE FILE IS OF RANDOM ORGANIZATION, THE
*,*               SIZE IS APPENDED TO THE FPT. IN ANY CASE THE FPT
*,*               FORMS THE FIRST LOGICAL RECORD OF THE BLOCKED FILE
*,*               TO BE TRANSMITTED.
*,*                    THE FILE IS THEN OPENED WITH THE PROPER ORG-
*,*               ANIZATION, AND RECORDS ARE READ SEQUENTIALLY.
*,*               AS EACH RECORD IS READ, IT IS WRITTEN AS A LOGICAL
*,*               RECORD, PRECEDED BY ITS SIZE, KEY, AND GRANULE #
*,*               WHERE APPLICABLE.
*,*                    WHEN THE END-OF-FILE IS REACHED, THE EOF
*,*               RECORD IS WRITTEN, THE STREAM SUPER-CLOSED, AND
*,*               COMMAND CHAINING CHECKED.
SEND     EQU      %                 ONLY ONE VLP VECTOR FOR SEND.
         LI,R3    SNDB:VEC
SLP      EQU      %
         STW,R3   SLPB:VEC
         LI,R3    LASTBIT
         BAL,R15  SIGSWTCH
         STS,R3   *PSIGLOC          DUE TO OUR METHOD OF MEMORY
         LI,R7    1                 MANAGEMENT, WE HAVE TO MOVE
         BAL,R15  MMG               THE FRAMEWORK OF THE FPT TO
         B        NGEND             A COMMON PAGE IN ORDER TO A-
         LW,R8    SIGLOC            VOID OVERWRITING MESSAGES AL-
         AI,R9    6                 READY BUILT.
         STW,R9   SSIGLOC
         SLD,R8   2
         LB,R10   *SIGLOC,R6
         BEZ      %+3
         AW,R10   SIGLOC
         B        %+4
         LB,R10   *PSIGLOC
         BEZ      %+4
         AW,R10   PSIGLOC
         SLS,R10  2
         B        %+2
         LW,R10   SIGEND
         SW,R10   R8
         STB,R10  R9
         MBS,R8   0
         AI,R9    3
         AND,R9   XFFFFFFFC
         STW,R9   SSIGEND
         B        LSTA:ALL          SKIP TO OPEN
SIGSWTCH EQU      %
         LI,R6    1
         LB,R5    *SIGLOC,R6        PICK OUT
         BEZ      %+2
         AI,R15   1
         AW,R5    SIGLOC
         XW,R5    SIGLOC            SETUP NEW SIGLOC AND
         B        *R15              PICK UP CURRENT ONE.
SLPPRY   EQU      %
         STW,R3   SLPB:VEC          STORE AWAY VLP VECTORTABLE.
LSTA:ALL EQU      %
         LI,R7    IN
         LI,R6    TRGTOPEN
         BAL,R15  OPEN
         LI,R7    0
         LI,R3    SNDBIT            IF SEND COMMAND, FIND END OF
         CW,R3    *PSIGLOC          PARAMETER LIST, RESET THE LAST
         BAZ      SLP:DNM           PARAMETER SPECIFICATION, AND
         LW,R5    SSIGLOC           PICK UP THE END OF THE PARAM.
SLP:FLC  EQU      %                 LIST.
         AI,R5    1
         CB,R3    *R5,R3
         BE       SLP:FND
         LW,R6    0,R5
         AND,R6   M8
         AW,R5    R6
         B        SLP:FLC
SLP:FND  EQU      %
         STB,R7   *R5,R3
         LW,R11   SSIGEND
SLP:DNM  EQU      %
         LW,R13   *SIGLOC
SLP1     EQU      %
         LW,R8    SLPARAM,R7
         LB,R2    R8
         AND,R2   M5
         LB,R4    *SLPB:VEC,R2
         BEZ      %+4
         ANLZ,R10 SLP1              POINT TO PARAMETER ( NOT CONTROL
         AI,R10   1                  WORD )
         B        SLP:,R4
SLP:     EQU      %
SLP:CONT EQU      %
         CB,R3    R8,R3             BUMP POINTER PAST CURRENT
         BANZ     SLP%1             PARAMETER UNLESS THAT WAS
         AW,R7    R8                LAST PARAMETER.
         AI,R7    1
         AND,R7   M8
         B        SLP1
* * * * * * * * * * * * * * * * * * * * * * * * * *
SLPMOVE  EQU      %
         OR,R13   SLP:BITS,R2       SET APPRO. BIT(S)
         AI,R10   -1                MOVE PARAMETER AND CONTROL
         SLS,R10  2                 WORD INTO PARAMETER LIST,
         LW,R0    R8                (R11), AND CONTINUE.
         AND,R0   M8
         AI,R0    1
         SLS,R0   2
         STW,R11  SLP:LAST
         STB,R0   R11
         MBS,R10  0
         B        SLP:CONT
* * * * * * * * * * * * * * * * * * * * * * * * * *
LPGRAN   EQU      %
         LI,R6    7                 PICK UP GRANULE COUNT, CONVERT
         LW,R5    SLPARAM+1,R7      TO DECIMAL PRINTABLE CHARS AND
         AWM,R5   LNGRAN            PLACE IN MESSAGE.
         LI,R11   SLP:CONT
         LI,R10   GRAN
LPG1     EQU      %
         LI,R4    0                 CONVERT HEXADECIMAL # (R5) TO
         DW,R4    XA                PRINTABLE DECIMAL, AND PLACE
         AI,R4    X'F0'             IN LOCATION (R10) INDEXED BY
         STB,R4   *R10,R6           R6, BLANK PADDED.
         AI,R5    0
         BEZ      %+2
         BDR,R6   LPG1
         LI,R4    SPACE
         B        %+2
         STB,R4   *R10,R6
         BDR,R6   %-1
         B        *R11
* * * * * * * * * * * * * * * * * * * * * * * * * *
LPACCT   EQU      %
         LW,R1    SLP:BITS,R2       SET APPRO. PRESENCE BIT.
         STS,R1   *SIGLOC
         LW,R1    BLKLPA,R2         MOVE ACCOUNTS INTO MESSAGE
         MBS,0    BA(BLANK)         AFTER STRIPPING TRAILING
         LW,R5    BLKLPA,R2         BLANKS.
         LI,R13   COMMA
         LI,R1    SPACE
         LI,R6    -2
         LB,R12   *R10,R6
LPA1     EQU      %
         LI,R6    7
         CB,R1    *R10,R6
         BNE      %+2
         BDR,R6   %-2
         AI,R6    1
         LW,R4    R10
         SLS,R4   2
         STB,R6   R5
         MBS,R4   0
         AI,R12   -2
         BLEZ     LPA2
         STB,R13  0,R5
         AI,R5    2
         AI,R10   2
LPA2     EQU      %
         SW,R5    LPALG,R2
         LW,R1    LPAST,R2
         STB,R5   0,R1
         B        SLP:CONT
* * * * * * * * * * * * * * * * * * * * * * * * * *
LPNEVER  EQU      %
         LD,R4    NEVER             CHECK DATE (R10) FOR
         CW,R4    SLPARAM+1,R7      'NEVER' AND STORE IT AWAY
         BNE      LPDATE            IN MESSAGE IF SO.
         CW,R5    SLPARAM+2,R7      OTHERWISE FALL INTO LPDATE.
         BNE      LPDATE
         STD,R4   EXPDATE
         B        SLP:CONT
* * * * * * * * * * * * * * * * * * * * * * * * * *
LPDATE   EQU      %
         LI,R6    3
         LH,R5    *R10,R6           PICK UP YEAR.
         AND,R5   M16
         SLS,R5   8
         OR,R5    BLANK
         LW,R4    LPLAC3,R2
         STW,R5   0,R4
         AI,R6    -3
         LH,R5    *R10,R6           PICK UP MONTH (#).
         LI,R4    0
         AND,R5   STRANGEMASK
         CI,R5    X'100'
         BAZ      %+2
         AI,R5    -X'100'+10
         LW,R5    MONTHS,R5
         LW,R4    LPLAC2,R2
         STW,R5   0,R4
         AI,R6    1
         LH,R5    *R10,R6           PICK UP DAY.
         CI,R5    X'F00'
         BANZ     %+2
         AI,R5    -X'B000'
         LW,R4    LPLAC1,R2
         STH,R5   0,R4
         B        SLP:CONT
* * * * * * * * * * * * * * * * * * * * * * * * * *
LSTACCT  EQU      %
         MTW,1    LNFILES           MOVE IN FILENAME AND
         LW,R5    SIGLOC            COUNT UP # OF FILES.
         LI,R15   LSTA:ALL
         LI,R4    1
LSTMOVE  EQU      %
         LI,R9    LSTROUND
LSTMBS   EQU      %
         LW,R11   SLDPTR
         LB,R12   *R10
         MTB,1    *SLDBGN,R4
         AI,R12   1
         STB,R12  R11
         SLS,R10  2
LMBS     EQU      %
         MBS,R10  0
         B        *R9
LSTROUND EQU      %
         AI,R11   3
         AND,R11  XFFFFFFFC
         STW,R11  SLDPTR
         B        *R15
LSTAC1   EQU      %
         BAL,R15  SIGSWTCH          CHECK FOR SECONDARY LINK.
         B        LSTAEND           NO.
         B        LST1              YES : REENTER.
* * * * * * * * * * * * * * * * * * * * * * * * * *
LPNAME   EQU      %
         LI,R15   SLP:CONT
         LB,R12   *R10              MOVE IN FILE NAME AND
         AI,R12   1                 CORRECT LENGTH OF MESSAGE.
         LI,R11   BA(LNAME)
         STB,R12  R11
         SLS,R10  2
         MBS,R10  0
         LI,R11   SPACE
         STB,R11  LNAME
         LB,R11   ORG
         AW,R12   R11
         STB,R12  ORG
         LI,R11   SNDBIT
         CW,R11   *PSIGLOC
         BAZ      %+2
         MTW,-1   *PSIGLOC
         B        *R15
RSTORG   DATA     X'1F404040'
* * * * * * * * * * * * * * * * * * * * * * * * * *
LPORG    EQU      %
         MTW,1    LNFILES           COUNT UP FILE COUNT, MOVE
         LB,R4    *R10              IN ORG, AND DETERMINE #
         LW,R4    LORG,R4           OF RECORDS.
         AWM,R4   ORG
         M:PRECORD M:EI,(N,32767)
LPABN    EQU      %
         LH,R4    M:EI+4
         AND,R4   XFFFF
         SLS,R4   -1
         LI,R5    32767
         SW,R5    R4
         LI,R6    7
         LI,R10   REC
         BAL,R11  LPG1
LPO3     EQU      %
         BAL,R15  FSVLP
         LD,R6    BLANK
         STD,R6   ACCT
         LI,R4    SNDBIT
         CW,R4    *PSIGLOC
         BANZ     %+4
         LI,R10   LALEADER          MOVE FINISHED MESSAGE TO
         BAL,R15  LSTMOVE           BUFFER TO BE PASSED.
         MTW,1    *PSIGLOC
         LI,R10   ORG               LOOK FOR APPRO. MESSAGES
         BAL,R15  LSTMOVE           TO BE APPENDED.
         LW,R13   RSTORG
         STW,R13  ORG
         LW,R13   *SIGLOC
         CI,R13   RDACBIT
         BAZ      %+3
         LI,R10   READAC
         BAL,R15  LSTMOVE
         CI,R13   WRACBIT
         BAZ      %+3
         LI,R10   WRITAC
         BAL,R15  LSTMOVE
         CI,R13   LEABIT
         BAZ      LPO1
         LI,R6    4
         LW,R10   LSTMADD,R6
         BAL,R15  LSTMOVE
         BDR,R6   %-2
LPO1     EQU      %
         CAL1,1   CLS               IF LISTING ACCT, CONTINUE.
         LW,R5    *SIGLOC           OTHERWISE CHECK FOR SECOND-
         CI,R5    NXTFBIT           ARY LINK.
         BAZ      LPO2
         LW,R5    SIGLOC
         B        LSTA:ALL
LPO2     EQU      %
         BAL,R15  SIGSWTCH
         B        LSTEND
         B        LST1
* * * * * * * * * * * * * * * * * * * * * * * * * *
SLPGRAN  EQU      %
         LW,R4    *R10              SAVE GRAN COUNT TEMP. SINCE
         STW,R4   OILINK            IT MAY BE NECESSARY (RANDOM).
         B        SLP:CONT
* * * * * * * * * * * * * * * * * * * * * * * * * *
SLPORG   EQU      %
         LB,R4    *R10              PICK UP ORG.
         STS,R13  *SSIGLOC          PUT AWAY ACCUM. BITS
         LW,R13   SNDSGMSK          SET UP THE COMMON DATA
         LS,R13   *PSIGLOC          SIGLOC AS NEEDED ( WITH
         STS,R13  *SSIGLOC          ORG AND COMMAND BITS. )
         STB,R4   *SSIGLOC
         CI,R4    KEYED             WILL ACCESS KEYED AS SEQUEN.
         BNE      %+2
         AI,R4    -1
         LW,R5    SLP:LAST          SET LAST PARAMETER FLAG,
         STW,R11  SLP:LAST          AND SAVE ENDING LOCATION.
         AI,R5    1
         STB,R3   0,R5
         LI,R7    IN                REALLY OPEN FILE WITH RITE
         LI,R6    PASSOPEN          SPECS.
         LW,R5    PSIGLOC
         BAL,R15  OPEN
         LW,R7    SSIGLOC
         LW,R5    SLP:LAST
         AI,R7    -5
         CI,R4    KEYED             IF RANDOM, MOVE IN
         BLE      SLPO1             GRAN COUNT.
         AI,R5    3
         SLS,R5   -2
         LW,R15   OILINK
         STW,R15  0,R5
         SW,R5    SSIGLOC
         LI,R6    1
         STB,R5   *SSIGLOC,R6
         AI,R5    6
         SLS,R5   2
         LI,R15   SLPO2
         B        XWRITE            GO WRITE FIRST RECORD.
SLPO1    EQU      %
         LW,R6    R7                WRITE FIRST RECORD.
         SLS,R6   2
         SW,R5    R6
         BAL,R15  XWRITE
* * * * * * * * * * * * * * * * * * * * * * * * * *
SLPO2    EQU      %
         LI,R7    2                 GET TWO COMMON PAGES.
         BAL,R15  MMG
         B        NGEND
         LB,R4    *SSIGLOC          PICK UP ORG
RD:RTY   EQU      %
         CI,R4    KEYED
         BG       RD:RDM
         AI,R9    14                SKIP : 8 WDS - KEY
         SLS,R8   11                     + 5 WDS - ACCT,NAME
         AI,R8    -56                    + 1 WD  - PHYS REC HDR
         BAL,R15  %+2
XREAD    EQU      %
         AI,R9    1
         M:READ   M:EI,(BUF,*R9),(SIZE,*R8),(ABN,ABN),(ERR,ABN)
         LW,R5    M:EI+13
         AI,R9    -1
         STW,R5   *R9
         AI,R5    4
         CI,R4    KEYED
         BL       XR1
         LW,R6    M:EI+10
         LB,R2    *R6
         AI,R2    4
         AND,R2   =X'FFFC'
         AW,R5    R2
         LW,R7    R9
         SLD,R6   2
         SW,R7    R2
         STB,R2   R7
         MBS,R6   0
         SLS,R2   -2
         LW,R7    R9
         SW,R7    R2
         B        XWRITE1
XR1      EQU      %
         LW,R7    R9
         B        XWRITE1
* * * * * * * * * * * * * * * * * * * * * * * * * *
RD:RDM   EQU      %
         AI,R9    X'200'
         AI,R8    -1
         SLS,R8   11
         LI,R3    0
         BAL,R15  %+2
RDRDM1   EQU      %
         AI,R9    1
         M:READ   M:EI,(BUF,*R9),(SIZE,2048),(BLOCK,*R3);
                  ,(ERR,ABN),(ABN,ABN)
         AI,R9    -1
         STW,R3   *R9
         LW,R7    R9
         AI,R3    1
         LW,R5    M:EI+13
         B        XWRITE1
* * * * * * * * * * * * * * * * * * * * * * * * * *
XWRITE   EQU      %
         LI,R1    1
         LCI      5
         LM,R10   *BASEADR,R1
         STM,R10  0,R7
XWRITE1  EQU      %
         LI,R11   0
         LW,R13   Y8
         LI,R6    RECSIZ
XLOOP    EQU      %
         AI,R7    -1
         AI,R5    4
         XW,R11   0,R7
         CW,R6    R5
         BGE      XEND
         AI,R5    -RECSIZ
,FPTWRIT M:WRITE  M:EO,(BUF,*R7),(SIZE,*R6),;
                  (ERR,ABN),(ABN,ABN)
         XW,R11   0,R7
         AI,R11   1
         AI,R7    RECSIZ**-2
         B        XLOOP
XEND     EQU      %
         LW,R6    R5
         STS,R13  0,R7
         CAL1,1   FPTWRIT
         XW,R11   0,R7
         B        *R15
* * * * * * * * * * * * * * * * * * * * * * * * * *
NRCNTERR EQU      %
         CI,R13   RAUFIL
         BG       URCNTERR
         MTW,1    NRERR
         BAL,R13  XCMPLT+1
         LI,R15   RANMFIL
         B        MMFDALL
* * * * * * * * * * * * * * * * * * * * * * * * * *
XCMPLTS  EQU      %
         M:WRITE  M:EO,(BUF,EOF),(SIZE,8),;
                  (ERR,ABN),(ABN,ABN)
         M:LDEV   'L4',(ASAVE)
XCMPLT   EQU      %
         LI,R13   XCHKSIG
         M:LDEV   'L2',(ASAVE)
         BAL,R15  MMFALL
         LW,R15   Y002
         CW,R15   M:EO
         BAZ      %+2
,CLSEO   M:CLOSE  M:EO,(SAVE)
XCMPLT1  EQU      %
         CW,R15   M:EI
         BAZ      %+2
,CLS     M:CLOSE  M:EI,(SAVE)
         M:LDEV   'L3',(ASAVE)
         B        *R13
* * * * * * * * * * * * * * * * * * * * * * * * * *
LSTAEND  EQU      %
         LI,R15   LSTA2
FSVLP    EQU      %
         LW,R5    *SIGLOC
         CI,R5    ACTBIT
         BAZ      *R15
         AI,R15   1
         STW,R15  OILINK
         LI,R11   2
         BAL,R15  FFVLP+1
         B        SLP%1
         LW,R6    0,R7
         LW,R7    1,R7
         B        *OILINK
LSTA2    EQU      %
         B        LSTA1
         STD,R6   NACCT
         MTB,6    NFILL
         MTB,6    NFILL
         B        %+3
LSTA1    EQU      %
         LI,R5    23
         STB,R5   NFILL
         LI,R10   NFILL+1
         B        SLDEND+1
LSTEND   EQU      %
         LI,R10   NFILL+1
         LI,R5    23
         STB,R5   NFILL
         LW,R5    *SIGLOC
         CI,R5    NXTFBIT
         BAZ      SLDEND+1
         LW,R5    LNFILES
         LI,R6    4
         LI,R11   LSTMOVE
         BAL,R15  LPG1
         LI,R10   NGRAN+1
         LW,R5    LNGRAN
         B        SLDEND+2
* * * * * * * * * * * * * * * * * * * * * * * * * *
ABN      EQU      %
         STW,R0   R12
         LI,R11   MINUTE
         BAL,R6   CHK%WAIT
         B        ABNRTN
         B        SIMCHK
         XW,R0    R12
         CI,R15   RAUFIL
         BG       UABN
         AND,R8   M17
         CI,R8    OPEN1
         BNE      %+2
         BAL,R15  OPEN1
         CI,R12   X'4200'
         BNE      %+4
         CI,R8    RDRDM1+2
         BE       %+4
         B        SIMMERC
         CI,R12   X'600'
         BNE      %+5
         LW,R0    *PSIGLOC
         CI,R0    SNDBIT
         BANZ     XCMPLTS
         B        LPABN
         LW,R14   *SIGLOC
         CI,R12   X'200'
         BNE      %+4
         CI,R14   LABIT+LEABIT
         BAZ      LSTAC1
         B        LPO2
         CI,R12   X'700'
         BNE      ABN1
         CI,R4    KEYED
         BG       SIMMERC
         M:PRECORD M:EI,(N,1),(REV)
THRSHLD  EQU      %
         LW,R7    LIMIT
         SW,R7    CURNODPG
         CW,R7    CURNOPG
         BLE      NGENDS
         SLS,R7   -1
         CW,R7    CURNOPG
         BG       %+3
         LW,R7    LIMIT
         SW,R7    CURNODPG
         BAL,R15  MMG
         B        NGENDS
         B        RD:RTY
BLKORG   EQU      %
         GEN,8,24 X'1F',BA(ORG)+1
ABN1     EQU      %
         CI,R15   NXTFBIT
         BAZ      SIMMERC
         CI,R12   X'4000'
         BGE      SIMMERC
         BAL,R15  FFVLP
         B        SLP%1
         LW,R10   R7
         CI,R14   LEABIT+LABIT
         BAZ      LSTACCT
         LW,R1    BLKORG
         MBS,0    BA(BLANK)
         BAL,R15  LPNAME+1
         AI,R11   BA(ORG)+2
         LI,R12   19
         LI,R10   BA(RAMSG)
         STB,R12  R11
         MBS,R10  0
         LB,R11   ORG
         AW,R11   R12
         STB,R11  ORG
         B        LPO3
SIMCHK   EQU      %
         CI,R15   RAUFIL
         BG       UABN
SIMMERC  EQU      %
         LI,R15   SIM2
         LW,R2    *PSIGLOC
         LI,R5    NRCMDS
         CB,R2    CMDTBL,R5
         BANZ     %+2
         BDR,R5   %-2
         B        *R15
SIM2     EQU      %
         LI,R4    1
         STW,R10  R0
         LW,R10   WHILCMD,R5
         BAL,R15  LSTMOVE
         BAL,R15  FFVLP
         B        SLP%1
         LW,R10   R7
SIMCONT  EQU      %
         BAL,R15  LSTMOVE
         LI,R15   SIM4
SIM3     EQU      %
         LW,R12   R0
         LH,R12   R12
         LI,R2    3
         LB,R11   R12,R2
         SLS,R11  -1
         STB,R11  R12,R2
         LI,R11   X'300'
         STH,R11  R12
         LI,R2    M:DO
         LW,R3    SLDPTR
         SLS,R3   -2
         BAL,R6   PAGEND
         B        NOGO
         LI,R4    RECSIZ
SIM1     EQU      %
         BAL,R11  ERRMSGE
         STB,R4   *R3
         B        0,R6
SIM4     EQU      %
         AI,R4    1
         LW,R11   R4
         LI,R4    1
         MTB,1    *SLDBGN,R4
         SLS,R3   2
         AW,R11   R3
         BAL,R15  LSTROUND
SIMCOM   EQU      %
         LW,R15   Y002
         CW,R15   M:EI
         BAZ      %+2
         CAL1,1   CLS
         B        %,R5
         B        DELEND
         B        SIMLST
         CAL1,1   CLSEO
         CAL1,1   OPEO3
         B        SLDEND1
SIMLST   EQU      %
         LW,R2    *SIGLOC
         CI,R2    NXTFBIT
         BAZ      LSTEND
         CI,R2    LEABIT+LABIT
         BAZ      LSTAEND
         B        LSTEND
ABNRTN   EQU      %
         AI,R8    -1
         B        *R8
* * * * * * * * * * * * * * * * * * * * * * * * * *
NOGO     EQU      %
         LW,R10   R7
         LW,R11   R15
         EOR,R1   M1
         BAL,R15  MMFALL1
         LW,R7    R10
         LW,R15   R11
         EOR,R1   M1
         B        MMG+1
NGENDCHK EQU      %
         LW,R15   Y002
         CW,R15   M:EO
         BAZ      NGABORT
NGEND    EQU      %
         BAL,R15  MMFDALL
         LI,R3    NRCMDS+1
         B        NRCMDF1
NGENDS   EQU      %
         CAL1,1   CLSEO             CLOSE M:EO DCB.
         M:LDEV   'L4',(DELETE),(ASAVE) REMOVE PARTIAL REQUEST.
NGENDSET EQU      %
         CAL1,1   OPEO1
         B        NGEND
NG1      EQU      %
         LI,R10   OOP
         LI,R9    SLDEND1
         B        LSTMBS
SLP%1    EQU      %
         BAL,R15  SIMMERC+1
         LI,R10   SLP1MSG
         LI,R15   SIMCOM
         B        LSTMOVE
NGABORT  EQU      %
         M:MESSAGE (MESS,NGAMSG)
         M:XXX
* * * * * * * * * * * * * * * * * * * * * * * * * *
OILDEV   EQU      %
         LI,R7    4
         STB,R7   R15
         STW,R15  OILINK
         LI,R7    1
         BAL,R15  MMG
         B        NGABORT
OIL1     EQU      %
         LB,R7    OILINK
         LCI      7
         LM,R0    LDEV
         EOR,R4   M5
         STW,R4   LDEV+4
         OR,R1    R7
         AI,R1    1
         CI,R7    2
         BG       %+2
         LW,R6    NAME
         LCI      7
         STM,R0   *CURADR
LINK     EQU      %
         M:LINK   'LDEV',':SYS',(ERROR)
         LW,R9    *CURADR
         BNEZ     OILERR
         MTB,-1   OILINK
         BGZ      OIL1
         B        *OILINK
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
OILERR   EQU      %
         LD,R8    WSNBUF
         STD,R8   OILMSG+4
         M:MESSAGE (MESS,OILMSG)
         B        RANWSN
* * * * * * * * * * * * * * * * * * * * * * * * * *
GET      EQU      %
         M:GCP    *R7
         M:GP     *R7
FREE     EQU      %
         M:FCP    *R7
         M:FP     *R7
MMINIT   EQU      %
         M:GDDL
         STW,R8   BASEADR
         STW,R8   CURDADR
         STW,R9   CURADR
         STW,R10  LIMIT
         LI,R8    0
         STW,R8   CURNOPG
         STW,R8   CURNODPG
         B        *R15
MMGD     EQU      %
         LI,R1    1
         B        MMG+1
MMG      EQU      %
         LI,R1    0
         AI,R15   1
         CW,R7    CURNOPG,R1
         BLE      MMG1
         CW,R7    LIMIT
         BG       NGENDCHK
         SW,R7    CURNOPG,R1
         EXU      GET,R1
         BCS,8    NG
         CI,R1    1
         BNE      MMG2
         MTW,0    CURNODPG
         BNEZ     %+2
MMG2     EQU      %
         STW,R9   CURADR,R1
         AW,R8    CURNOPG,R1
         STW,R8   CURNOPG,R1
         B        *R15
MMG1     EQU      %
         LW,R9    CURADR,R1
         LW,R8    CURNOPG,R1
         B        *R15
MMFD     EQU      %
         LI,R1    1
         B        MMF+1
MMF      EQU      %
         LI,R1    0
         CW,R7    CURNOPG,R1
         BLE      %+2
MMFALL1  EQU      %
         LW,R7    CURNOPG,R1
         BGZ      %+3
         BEZ      *R15
         B        %+3
         EXU      FREE,R1
         BCR,8    MMF1
         LI,R7    0
         STW,R7   CURADR,R1
MMF2     EQU      %
         STW,R7   CURNOPG,R1
         B        *R15
MMF1     EQU      %
         LW,R9    R7
         SLS,R9   9
         AWM,R9   CURADR,R1
         XW,R7    CURNOPG,R1
         SW,R7    CURNOPG,R1
         B        MMF2
MMFDALL  EQU      %
         LI,R1    1
         B        %+2
MMFALL   EQU      %
         LI,R1    0
         LW,R7    CURNOPG,R1
         AI,R7    -1
         B         MMFALL1+1
NG       EQU      %
         AI,R15   -1
         B        *R15
* * * * * * * * * * * * * * * * * * * * * * * * * *
OPEN     EQU      %
         LI,R9    PBITS
         LI,R8    0
         LS,R8    0,R5
         AI,R5    -3
         LCI      4
         LM,R0    0,R5
         LM,R10   0,R6
         STM,R10  0,R5
         STS,R8   1,R5
         CAL1,1   *R5
OPEN1    EQU      %
         LCI      4
         STM,R0   0,R5
         B        *R15
* * * * * * * * * * * * * * * * * * * * * * * * * *
ROPEN    EQU      %
         CI,R4    RANDOM
         BNE      OPEN
         LI,R3    1
         LB,R3    *R5,R3
         AW,R3    R5
         LW,R3    0,R3
         STW,R3   RSTORE
         LI,R9    PBITS
         LI,R8    0
         LS,R8    0,R5
         AI,R5    -4
         LCI      5
         LM,R0    0,R5
         LM,R10   PASSROPEN
         STM,R10  0,R5
         STS,R8   1,R5
         CAL1,1   0,R5
OPEN2    EQU      %
         LCI      5
         STM,R0   0,R5
         LI,R4    RANDOM
         B        *R15
* * * * * * * * * * * * * * * * * * * * * * * * * *
PAGEND   EQU      %
         XW,R15   R6
         LW,R7    X1FE00
         LS,R7    R3
         SLS,R7   -9
         AI,R7    1
         CB,R7    JB:TDP
         BGE      %+3
         AI,R15   1
         B        *R15
         LCW,R4   R3
         AND,R4   M9
         CI,R4    RECSIZ**-2
         BL       %+3
         AI,R15   2
         B        *R15
         LW,R7    LIMIT
         SW,R7    CURNOPG
         CW,R7    CURNODPG
         BLE      NOGO
         SLS,R7   -1
         CW,R7    CURNODPG
         BG       %+3
         LW,R7    LIMIT
         SW,R7    CURNOPG
         B        MMGD
* * * * * * * * * * * * * * * * * * * * * * * * * *
WSNCHK   EQU      %
         CAL1,1   CLSSO
         LI,R0    0
         STW,R0   WSNPOS
         MTW,0    FCOUNT
         BEZ      SLEEP
         STW,R0   FCOUNT
         B        RANWSN
SLEEP    EQU      %
         LI,R11   MINUTE
         BAL,R6   WAIT
         B        RASO
* * * * * * * * * * * * * * * * * * * * * * * * * *
RATLERR  EQU      %
         LI,R11   MINUTE
         BAL,R6   CHK%WAIT
         B        RANWSN
         B        %-3
         CI,R0    X'600'
         BE       WSNCHK
         M:MESSAGE (MESS,RATLMSG)
         M:XXX
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*F*      NAME:    RASO
*,*      PURPOSE: RASO INITIATES THE PROCESSING OF 'STANDING
*,*               ORDERS'.
*,*      DESCRIPTION:  RASO OPENS M:SO TO THE FILE 'ISCLS',
*,*               READING WITH A KEY FORMED FROM THE CURRENT
*,*               TIME. IF NO RECORD WITH THAT KEY EXISTS, THE
*,*               NEXT RECORD IS READ SEQUENTIALLY AND CHECKED
*,*               TO SEE IF IT IS TO BE PROCESSED AT THIS TIME.
*,*               IF SO, THE RECORD IS PASSED TO ISCL, VIA
*,*               M:LINK, AND THE READING CYCLE IS REPEATED.
*,*                    IF NOT, THE KEY IS REMEMBERED SO THAT
*,*               SUBSEQUENT ATTEMPTS NEED NOT READ THE FILE
*,*               TO DETERMINE IF A 'STANDING ORDER' IS TO BE
*,*               PROCESSED.
RASO     EQU      %
         LI,R7    1
         BAL,R15  MMG
         B        NGEND
         LI,R1    7
         M:TIME   TIME,TMS
         LB,R10   R9
         LH,R11   R9
         LH,R9    R8
         LW,R7    R9
         AI,R7    -1
         SLS,R7   -2
         AW,R9    R7
         AND,R8   M16
         AW,R9    R8
         LI,R8    0
CENTURYBASE EQU   %
         AI,R9    0
         DW,R8    R1
         LW,R9    R8
         BNEZ     %+2
         LI,R9    7
         AND,R11  M8
         LI,R1    10
         MI,R9    100
         AW,R9    R10
         MI,R9    10000
         DW,R11   R1
         MI,R11   1000
         LI,R1    3
         AW,R11   R9
         STB,R1   R11
         CW,R11   SOKEY
         BL       RARTN
         MTW,0    SOKEY
         BNEZ     %+2
         STW,R11  SOKEY
         STW,R11  CSOKEY
RASOPEN  M:OPEN   M:SO,(FILE,'ISCLS'),(ERR,ISCLERR),(ABN,ISCLERR),;
                  (KEYED),(SEQUEN),(IN),(SAVE)
         M:READ   M:SO,(BUF,*CURADR),(SIZE,79),(KEY,SOKEY),;
                  (ERR,ISCLERR),(ABN,ISCLERR),(BTD,1)
SOFOR    EQU      %
         LH,R4    M:SO+4
         SLS,R4   -1
         LW,R8    CURADR
         SLS,R8   2
         AI,R8    1
         AW,R4    R8
         LI,R15   SOF2
         LI,R5    X'40'
         LW,R2    CURADR
         SLS,R2   2
         AI,R2    1
SOF1     EQU      %
         CB,R5    0,R2
         BNE      *R15
         AI,R2    1
         CW,R2    R4
         BGE      SOCREAD
         B        SOF1
SOF2     EQU      %
         LI,R3    BA(TFOR)
         LI,R1    4
         STB,R1   R3
         LI,R15   SOF4
         CBS,R2   0
         BNE      SOF3
         LW,R11   BLANK
         STD,R11  SOACCT
         BAL,R15  SOF1
         LI,R3    BA(SOACCT)
         SW,R4    R2
         CI,R4    8
         BLE      %+2
         LI,R4    8
         STB,R4   R3
         MBS,R2   0
         LI,R15   SOCREAD
SOF3     EQU      %
         LD,R10   SOACCT
         STW,R10  J:ACCN
         STW,R11  J:ACCN+1
         LD,R10   RATLNAME
         STW,R10  J:UNAME
         STW,R11  J:UNAME+1
         B        *R15
SOF4     EQU      %
         LW,R7    R4
         SW,R7    R8
         STB,R7   *CURADR
ISLINK   M:LINK   'ISCL',':SYS',(CMD,*CURADR),(ERROR),(EXIT)
         B        SOCREAD
* * * * * * * * * * * * * * * * * * * * * * * * * *
ISCLERR  EQU      %
         LI,R11   MINUTE
         BAL,R6   CHK%WAIT
         B        RASOPEN
         B        RARTN
         CI,R0    X'4300'
         BNE      ISCLABT
SOCREAD  EQU      %
         M:READ   M:SO,(BUF,*CURADR),(SIZE,79),(ERR,ISCLERR),;
                  (ABN,ISCLERR),(BTD,1)
         LW,R4    *M:SO+10
         SW,R4    CSOKEY
         CI,R4    1000
         BL       SOFOR
SOCR1    EQU      %
         AW,R4    CSOKEY
         STW,R4   SOKEY
         B        RARTN
ISCLABT  EQU      %
         CI,R0    X'600'
         BNE      %+3
         LI,R4    0
         B        SOCR1
         AND,R8   M16
         CI,R8    RASOPEN+1
         BNE      SOCREAD
RARTN    EQU      %
         LW,R8    Y002
         CW,R8    M:SO
         BAZ      %+2
         CAL1,1   CLSSO
         B        RANWSN
* * * * * * * * * * * * * * * * * * * * * * * * * * *
SIERR    EQU      %
         LH,R9    R10
         CI,R9    X'300'
         BE       SINEND
         LW,R9    Y002
         CW,R9    M:SI
         BAZ      %+2
         CAL1,1   CLSSI
         LI,R13   RANMFIL+2
         B        XCMPLT1+3
SINEND   EQU      %
         BAL,R13  XCMPLT1+3
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*F*      NAME:    RAUFIL
*,*      PURPOSE: RAUFIL READS ALL BLOCKED FILES AND RECONSTRUCTS
*,*               THEM, INFORMING THE USER.
*,*      DESCRIPTION:  RAUFIL OPENS M:SI TO THE DEVICE 'FI' WITH
*,*               OUT A FORM NAME, READING 120-BYTE CHUNKS UNTIL
*,*               THE FIRST ( AS WELL AS SUBSEQUENTLY READ RECORDS )
*,*               RECORD IS COMPLETE.
*,*                    USING THE SAME CODE AS RANMFIL, THE :USERS
*,*               FILE IS CHECKED FOR ACCOUNT AUTHORIZATION, AND
*,*               IF SUCCESSFUL, THE FILE IS OPENED AS SPECIFIED.
*,*                    THEN THE APPROPRIATE ROUTINE IS ENTERED
*,*               ACCORDING TO THE ORGANIZATION OF THE FILE BEING
*,*               INTEGRATED.
RAUFIL   EQU      %
         M:OPEN   M:SI,(DEVICE,'L5'),(ERR,SUERR),(ABN,SUERR),(IN),;
                  (BTD,0)
         BAL,R13  NRUR
         LI,R15   RAU2
         LI,R7    INOUT
RAU1     EQU      %
         LB,R4    *SIGLOC
         AND,R4   M2
         LW,R5    PSIGLOC
         LI,R6    PASSOPEN
         B        ROPEN
RAU2     EQU      %
         LW,R5    *SIGLOC
         CI,R5    OVRBIT
         BAZ      UF%1
         CAL1,1   CLS
RAU3     EQU      %
         LI,R7    OUT
         BAL,R15  RAU1
         LW,R5    CURDADR
         AI,R5    2
         LW,R13   CURADR
         SLS,R13  2
         STW,R13  SLDPTR
         B        %,R4
         B        UCNSC
         B        UKEYD
         B        URNDM
* * * * * * * * * * * * * * * * * * * * * * * * * *
SUERR    EQU      %
         LH,R9    R10
         CI,R9    X'300'
         BNE      SUERR1
         LI,R1    1
         LI,R15   RANWSN
         B        MMFALL1
SUERR1   EQU      %
         LW,R9    Y002
         CW,R9    M:SI
         BAZ      %+2
         CAL1,1   CLSSI
         CW,R9    M:EI
         BAZ      %+2
         CAL1,1   CLSREL
         B        UKEND3
* * * * * * * * * * * * * * * * * * * * * * * * * *
UKEYD    EQU      %
         BAL,R13  UREAD
         LB,R5    *SIGLOC
         AI,R5    4
         SLS,R5   -2
         AW,R5    SIGLOC
         LW,R4    0,R5
         AI,R5    1
         M:WRITE  M:EI,(BUF,*R5),(SIZE,*R4),(NEWKEY),(KEY,*SIGLOC),;
                  (ERR,ABN),(ABN,ABN)
         B        UREAD
* * * * * * * * * * * * * * * * * * * * * * * * * *
UCNSC    EQU      %
         BAL,R13  UREAD
         LW,R4    *SIGLOC
         M:WRITE  M:EI,(BUF,*R5),(SIZE,*R4),;
                  (ERR,ABN),(ABN,ABN)
         B        UREAD
* * * * * * * * * * * * * * * * * * * * * * * * * *
URNDM    EQU      %
         BAL,R13  UREAD
         LW,R4    *SIGLOC
         M:WRITE  M:EI,(BUF,*R5),(SIZE,2048),(BLOCK,*R4),;
                  (ERR,ABN),(ABN,ABN)
         B        UREAD
* * * * * * * * * * * * * * * * * * * * * * * * * *
UREAD    EQU      %
         LI,R7    0
         STW,R7   NRECCNT
         LI,R7    2
         BAL,R15  MMGD
         B        NOGO
         SLS,R8   11
         LW,R9    CURDADR
         LW,R1    R9
         AI,R9    1
         STW,R9   SIGLOC
         CAL1,1   FPTREAD
         LD,R6    EOF
         CD,R6    *R1
         BNE      NR1
* * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * * * * * * * * * * * * * * * * * * * * * *
UEND     EQU      %
         LI,R15   UEND1
FFVLP    EQU      %
         LI,R11   1
         LI,R1    1
         LW,R7    M:EI+6
FFVLP1   EQU      %
         LW,R10   0,R7
         CB,R11   R10
         BNE      RFF1
         AI,R7    1
         AI,R15   1
         B        *R15
RFF1     EQU      %
         CB,R1    R10,R1
         BE       *R15
         AND,R10  M8
         AW,R7    R10
         AI,R7    1
         B        FFVLP1
UEND1    EQU      %
         B        USLP%1
         SLS,R7   2
         LB,R12   0,R7
         LW,R10   R7
         AI,R10   1
         LI,R11   BA(HSMSG1)
         STB,R12  R11
         MBS,R10  0
         LB,R13   HSMSG
         AW,R12   R13
         STB,R12  HSMSG
         LI,R1    X'C0'
         STB,R1   JB:PRIV
         CAL1,1   CLS
         LI,R10   HSMSG
         LI,R11   UKEND2
UKEND1   EQU      %
         LW,R6    J:ACCN
         LW,R7    J:ACCN+1
         STD,R6   MAILACCT
         LD,R0    RATLNAME
         STW,R0   J:ACCN
         STW,R1   J:ACCN+1
         B        %+2
UKEND4   EQU      %
         LI,R11   UKEND2+1
         STW,R10  MAIL
         LI,R10   MAIL
         LI,R15   1
         B        MAILBOX
UKEND2   EQU      %
         STB,R13  HSMSG
         CAL1,1   CLSSI
UKEND3   EQU      %
         M:LDEV   'L5',(ASAVE)
         BAL,R15  MMFALL
         B        RAUFIL
* * * * * * * * * * * * * * * * * * * * * * * * * *
UABN     EQU      %
         AND,R8   XFFFF
         LI,R15   %+6
         CI,R8    OPEN2
         BE       OPEN2
         CI,R8    OPEN1
         BNE      %+4
         B        OPEN1
         CI,R12   X'300'
         BE       RAU3
         LI,R10   UABN2
UABN1    EQU      %
         STW,R10  OILINK
         LI,R10   X'C0'
         STB,R10  JB:PRIV
         LI,R10   WHILSND
         BAL,R11  UKEND1
         BAL,R15  FFVLP
         B        USLP%1
         LW,R10   R7
         BAL,R11  UKEND4+1
         B        *OILINK
UABN2    EQU      %
         BAL,R15  SIM3
         LW,R10   R3
         CAL1,1   CLSREL
         B        UKEND4
* * * * * * * * * * * * * * * * * * * * * * * * * *
USLP%1   EQU      %
         CAL1,1   CLSREL
         LI,R10   SLP1MSG
         B        UKEND4
UF%1     EQU      %
         CAL1,1   CLS
         BAL,R10  UABN1
         LI,R10   UF1MSG
         B        UKEND4
* * * * * * * * * * * * * * * * * * * * * * * * * *
URCNTERR EQU      %
         MTW,1    URERR
         CI,R13   RAU1
         BL       UKEND3-1
         BAL,R10  UABN1
         LI,R10   URCTMSG
         B        UKEND4
* * * * * * * * * * * * * * * * * * * * * * * * * *
XCON     EQU      %
         LC       R12
         BCS,8    XC2
         LI,R3    X'1FFFF'
         LI,R2    0
         LS,R2    0,R1
         BCR,4    XC1
         MTW,1    0,R1
         CI,R2    LINK
         BE       %+3
         CI,R2    ISLINK
         BNE      XC2
         EXU      0,R2
         CAL1,8   XCTL
         M:TRTN   XCON
XC1      EQU      %
         CI,R8    1
         BAZ      XC2
         CI,R10   X'A4'
         BNE      XC2
         CI,R11   X'04'
         BNE      XC2
         CI,R2    LMBS
         BNE      XC2
         LW,R7    CURNODPG
         AI,R7    1
         BAL,R15  MMGD
         B        NOGO
         M:TRTN   XCON
XC2      EQU      %
         M:XXX
* * * * * * * * * * * * * * * * * * * * * * * * * * *
ADJUST   EQU      %
         GEN,8,24 X'14',M:SL
         DATA     X'E001'
         DATA     X'C7820000'
         DATA     LOGERR
         DATA     LOGERR
         DATA     2
         DATA     2
         DATA     1
         DATA     2
         DATA     0
         DATA     X'01000202'
         TEXTC    ':USERS'
         DATA     X'02000202'
         TEXT     ':SYS    '
         DATA     X'03010202'
         DATA,8   X'DFEF803FAFC0BF9F'
CMDTBL   EQU      %
         DATA,1   0                 DUMMY ENTRY
         DATA,1   DELBIT
         DATA,1   LSTBIT
         DATA,1   SNDBIT
NRCMDS   EQU      BA(%)-BA(CMDTBL)-1
         BOUND    4
CMDRTN   EQU      %-1
         B        DELETE
         B        LIST
         B        SEND
         B        NG1               THIS FAKED ENTRY SHOULD FOLLOW
*                                   ALL CMDRTN COMMAND ENTRIES
LALB:VEC EQU      %
         BYTE     SLP:
         BYTE     LSTACCT
         DO1      15
         BYTE     SLP:CONT
         BOUND    4
SNDB:VEC EQU      %
         BYTE     SLP:
         DO1      3
         BYTE     SLP:CONT
         DO1      3
         BYTE     SLPMOVE
         BYTE     SLP:CONT
         BYTE     SLP:CONT
         BYTE     SLPORG
         DO1      3
         BYTE     SLP:CONT
         BYTE     SLPGRAN
         BYTE     SLP:CONT
         BYTE     SLP:CONT
         BOUND    4
LAB:VEC  EQU      %
         BYTE     SLP:
         BYTE     LPNAME
         DO1      3
         BYTE     SLP:CONT
         BYTE     LPACCT
         BYTE     LPACCT
         BYTE     SLP:CONT
         BYTE     SLP:CONT
         BYTE     LPORG
         BYTE     LPDATE
         BYTE     SLP:CONT
         BYTE     SLP:CONT
         BYTE     LPGRAN
         DO1      3
         BYTE     SLP:CONT
         BOUND    4
LEAB:VEC EQU      %
         BYTE     SLP:
         BYTE     LPNAME
         BYTE     SLP:CONT
         BYTE     SLP:CONT
         BYTE     LPNEVER
         BYTE     LPACCT
         BYTE     LPACCT
         BYTE     SLP:CONT
         BYTE     SLP:CONT
         BYTE     LPORG
         BYTE     LPDATE
         DO1      3
         BYTE     SLP:CONT
         DO1      3
         BYTE     LPDATE
         BOUND    4
         BOUND    8
NEVER    TEXT     'NEVER   '
         BOUND    8
LALEADER EQU      %
         TEXTC    'ORG    GRAN     REC     DATE   ACCOUNT     NAME'
LPAST    EQU      %-5
         DATA     BA(READAC)
         DATA     BA(WRITAC)
MONTHS   EQU      %-1
         DATA     ' JAN'
         DATA     ' FEB'
         DATA     ' MAR'
         DATA     ' APR'
         DATA     ' MAY'
         DATA     ' JUN'
         DATA     ' JUL'
         DATA     ' AUG'
         DATA     ' SEP'
         DATA     ' OCT'
         DATA     ' NOV'
         DATA     ' DEC'
LPLAC3   EQU      %-4
         DATA     EDAT3
STRANGEMASK DATA  X'10F'
BLKLPA   EQU      %-5
         GEN,8,24 79,BA(READAC)+10
         GEN,8,24 79,BA(WRITAC)+10
LPALG    EQU      %-5
         DATA     BA(READAC)+1
         DATA     BA(WRITAC)+1
         DATA     MDAT3
LPLAC2   EQU      %-4
         DATA     EDAT2
NGAMSG   EQU      %
         TEXTC    'NO CORE'
         DATA     CDAT3
         DATA     ADAT3
         DATA     BDAT3
         DATA     MDAT2
LPLAC1   EQU      %-4
         DATA     EDAT1
CHKM1    EQU      %
         GEN,8,24 8,BA(KEYBUF)+1
CHKM2    EQU      %
         GEN,8,24 12,BA(KEYBUF+2)+2
         DATA     CDAT2
         DATA     ADAT2
         DATA     BDAT2
         DATA     MDAT1
SLP:BITS EQU      %-4
         DATA     EXPBIT
         DATA     RDACBIT
         DATA     WRACBIT
         DATA     CDAT1
         DATA     ADAT1
         DATA     BDAT1
XFFFFFFFC DATA    X'FFFFFFFC'
LORG     EQU      %
         DATA     X'00008300'
         DATA     X'00008300'
         DATA     X'00009200'
         DATA     X'00009900'
LSTMADD  EQU      %-1
         DATA     ADATE
         DATA     BDATE
         DATA     CDATE
         DATA     EDATE
NOTLIGIT EQU      %
         TEXTC    'NOT AUTHORIZED IN REMOTE SYSTEM'
WHILCMD  EQU      %-1
         DATA     WHILDEL
         DATA     WHILLST
         DATA     WHILSND
WHILDEL  EQU      %
         TEXTC    '.. DELETING FILE'
         BOUND    4
WHILLST  EQU      %
         TEXTC    '.. LISTING FILE'
WHILSND  EQU      %
         TEXTC    '.. SENDING FILE'
ADJUSTEI EQU      %
         GEN,8,24 X'14',M:EI
         DATA     X'E001'
         DATA     X'C0000000'
         DATA     ABN
         DATA     ABN
         DATA     X'01010101'
         DATA     0
ADJUSTDO EQU      %
         GEN,8,24 X'14',M:DO
         DATA     X'A001'
         DATA     X'20000'
         DATA     1                 BTD
OOP      EQU      %
         TEXTC    '..CANT GET PAGE'
SLP1MSG  EQU      %
         TEXTC    'CLOBBERED FILE PARAMETERS'
UF1MSG   EQU      %
         TEXTC    'FILE EXISTS - CANNOT COPY'
URCTMSG  EQU      %
         TEXTC    'TRANSMISSION ERROR'
NAME     EQU      %
         DATA     'ISCL'
RATLMSG  EQU      %
         TEXTC    'RATL.:SYS ERR'
         BOUND    8
EOF      EQU      %
         DATA     X'80000000'
         DATA     -1
SNDSGMSK EQU      %
         DATA     WSNBIT+RVRSBIT+OVRBIT+SNDBIT
DCB      EQU      %-1
         DATA     M:SI,M:EI,M:EO
NDCBS    EQU      %-DCB-1
CLSDCB   EQU      %-1
         DATA     CLSSI,CLS,CLSEO
SUERR1ADR EQU     %
         DATA     X'00C00000'+SUERR1
XCHKADR  EQU      %
         DATA     X'00C00000'+XCHKSIG
X1FE00   DATA     X'1FE00'
Y8       DATA     X'80000000'
Y002     DATA     X'00200000'
M16      DATA     X'FFFF'
XFFFF    EQU      M16
XA       DATA     X'A'
M5       DATA     X'1F'
M8       DATA     X'FF'
M9       DATA     X'1FF'
M1       DATA     1
M2       DATA     3
M17      DATA     X'1FFFF'
         BOUND    8
BLANK    DATA     X'40404040'
         DATA     X'40404040'
TESTBIT  DATA     X'00080000'
MPJAC    DATA     ~(3**DISP)
         BOUND    8
RATLNAME EQU      %
         TEXT     'RATLER  '
TFOR     EQU      %
         TEXT     'FOR '
RAMSG    EQU      %
         TEXT     '*RESTRICTED ACCESS*'
* * * * * * * * * * * * * * * * * * * * * * * * * *
         USECT    RAD
OILMSG   EQU      %
         TEXTC    'BAD RATL WSN :         '
TRGTOPEN EQU      %
         GEN,8,5,19 X'14',1,M:EI
         DATA     X'1200001'
         DATA     X'80000007'
         DATA     SLPARAM
PASSOPEN EQU      %
         GEN,8,24 X'14',M:EI
         DATA     X'5000001'
         DATA     X'80000004'
         DATA     X'80000007'
LDEV     EQU      %
         DATA     0
         DATA     X'D3F0'
         BOUND    8                 THIS DW SHOULD NOT WASTE
WSNBUF   EQU      %
         RES      2
         DATA     'FO'
         DATA     0
         DATA     0
PASSROPEN EQU     %
         GEN,8,24 X'14',M:EI
         DATA     X'5001001'
         DATA     RANDOM
         DATA     X'80000007'
RSTORE   EQU      %
         DATA     0
SLDBGN   EQU      %
         RES      1
SIGEND   EQU      %
         RES      1
PSIGLOC  EQU      %
         RES      1
SIGLOC   EQU      %
         RES      1
SSIGLOC  EQU      %
         RES      1
SSIGEND  EQU      %
         RES      1
LIMIT    EQU      %
         RES      1
SLPB:VEC EQU      %
         RES      1
         RES      1
KEYBUF   EQU      %
         RES      6
SLPARAM  EQU      %
         RES      90
NRECCNT  EQU      %
         RES      1
NRERR    EQU      %
         DATA     0
URERR    EQU      %
         DATA     0
         BOUND    8
MAIL     EQU      %
         DATA     0
         DATA     MAILACCT
MAILACCT EQU      %
         DATA,8   0
SLDPTR   EQU      %
         DATA     0
LNGRAN   EQU      %
         DATA     0
LNFILES  EQU      %
         DATA     0
ORG      EQU      %
         TEXTC    '                               '
         RES      8
GRAN     EQU      ORG+1
REC      EQU      GRAN+2
MDAT1    EQU      HA(REC)+5
MDAT2    EQU      REC+3
MDAT3    EQU      MDAT2+1
ACCT     EQU      MDAT3+1
LNAME    EQU      ACCT+3
SLP:LAST EQU      %
         DATA     0
READAC   EQU      %
         TEXTC    '  READ =    '
         DO1      19
         DATA     '    '
WRITAC   EQU      %
         TEXTC    '  WRITE=   '
         DO1      19
         DATA     '    '
* * * * * * * * * * * * * * * * * * * * * * * * * *
         BOUND    8
EDATE    EQU      %
         TEXTC    '     WILL EXPIRE               '
EXPDATE  EQU      EDATE+6
EDAT1    EQU      HA(EDATE)+11
EDAT2    EQU      EDATE+6
EDAT3    EQU      EDATE+7
CDATE    EQU      %
         TEXTC    '     CREATED  ON               '
CDAT1    EQU      HA(CDATE)+11
CDAT2    EQU      CDATE+6
CDAT3    EQU      CDATE+7
ADATE    EQU      %
         TEXTC    '     LAST ACCESS ON            '
ADAT1    EQU      HA(ADATE)+11
ADAT2    EQU      ADATE+6
ADAT3    EQU      ADATE+7
BDATE    EQU      %
         TEXTC    '     BACKED UP ON              '
BDAT1    EQU      HA(BDATE)+11
BDAT2    EQU      BDATE+6
BDAT3    EQU      BDATE+7
CURNOPG  DATA     0
CURNODPG DATA     0
CURADR   DATA     0
CURDADR  DATA     0
NFILD    EQU      %
         TEXTC    '..       FILES DELETED'
         BOUND    8
OILINK   EQU      %
         RES      1
NFILL    EQU      %
         TEXTC    '..        FILES  LISTED'
         TEXT     ' IN         '
NACCT    EQU      %-2
NGRAN    EQU      %
         TEXTC    '..       TOTAL GRANULES'
FCOUNT   EQU      %
         DATA     0
HSMSG    EQU      %
         TEXTC    'HAVE SENT: '
TIME     EQU      %
HSMSG1   EQU      %
         RES      8
CSOKEY   EQU      %
         DATA     0
         BOUND    8
SOACCT   EQU      %
         DATA,8   0
SOKEY    EQU      %
         DATA     0
BASEADR  EQU      %
         DATA     0
RATCH    EQU      %
         RES      100
         END      RAP
