* CATALOG NO. 704988  SIGMA 5/7 SORT             OVERLAY 3
*  VERSION C00
         SYSTEM   SIG7FDP
         SYSTEM   BPM
*
PGMSEG3  CSECT    0
*
         PAGE
*
         DEF      MCR1X,MFPSX,MFP4X,MRSX,MEB9X,MWRTX
         DEF      MSWR1X,MREADX,OPCLSX
         REF      BCT0,CCT0,FCT0,FCT1,FCT2,FCT3,FCT4,ILT0
         REF      SD1,OB1,CSI,CSO,OU1,CO1,OS1
         REF      EBCBN,BINEBC,KRDSC,KRASC                 /SIG7-4137/*E4985
         REF      F:SORTOUT,OSO,OCSAV,CNVRT                /SIG7-1162/*C4988
         REF      ILT1,SEQLNG,SEQRCD,RWMOV
         REF      SC5                                      /SIG7-1162/*C4988
         REF      SIN1R
         REF      ENDSORT
         REF      COMSTOPA,COMSTOPD
         REF      ANSISWOU,KTTL
         REF      MCRR,MSWR1,MOWR1,MFP25,MREAD,MFPWT,MFP3
         REF      NUMPGS,RIT
         REF      MRS1,MEB1,MWRITER,MFPWTR,MRGSEL,MREAD0,OPCLSR
         REF      MEMPROSW
*        LINE 17 REMOVED FOR UTS
*
         PAGE
*
X1       EQU      1
X2       EQU      2
X3       EQU      3
X4       EQU      4
X5       EQU      5
X6       EQU      6
X7       EQU      7
R0       EQU      8
R1       EQU      9
R2       EQU      10
RA       EQU      10
RB       EQU      11
RC       EQU      12
RD       EQU      13
RE       EQU      14
RF       EQU      15
*
         PAGE
*
PTMESS   DATA     0
*
SRTIN    TEXTC    'RECORDS INPUT:                     '
SRTOT    TEXTC    'RECORDS OUTPUT:                    '
TRNSIZ   TEXTC    'RECORDS IN TOURNAMENT:             '
BUFSIZ   TEXTC    'INTERMEDIATE BUFFER SIZE:          '
BUFNUM   TEXTC    'NUMBER OF MERGE BUFFERS:           '
INSCNT   TEXTC    'RECORDS INSERTED IN:               '
OUSCNT   TEXTC    'RECORDS INSERTED OUT:              '
DELCNTA  TEXTC    'RECORDS DELETED IN:                '
DELCNTB  TEXTC    'RECORDS DELETED OUT:               '
*
STOPCMPA B        *9                 FOR SEQ CHK
STOPCMPD B        *9                 FOR SEQ CHK
         PAGE
MCR1X    RES      0
         LI,15    ENDP31
         STW,15   ENDSORT           IN CASE OF ERROR DUMP
*
         LI,15    0
         STW,15   CNVRT
         LW,RF    RIT
         STW,15   CNVRT+1           TOURNAMENT SIZE
         BAL,5    BINEBC
         LCI      2
         LM,14    CNVRT
         STM,14   TRNSIZ+7
         M:PRINT  (MESS,TRNSIZ)
*
         LI,15    0
         STW,15   CNVRT
         LH,15    ILT0,1
         SAS,15   1
         STW,15   CNVRT+1           NUMBER OF MERGE BUFFERS
         BAL,5    BINEBC
         LCI      2
         LM,14    CNVRT
         STM,14   BUFNUM+7
         M:PRINT  (MESS,BUFNUM)
*
         LI,15    0
         STW,15   CNVRT
         LH,15    BCT0+3,1          MERGE BUFFER LENGTH IN BYTES
         SAS,15   2
         STW,15   CNVRT+1
         BAL,5    BINEBC
         LCI      2
         LM,14    CNVRT
         STM,14   BUFSIZ+7
         M:PRINT  (MESS,BUFSIZ)
*
         LI,15    0
         STW,15   CNVRT
         LW,15    BCT0+6            TOTAL RECORD INTO SORT
         STW,15   CNVRT+1           RECORDS INTO SORT FROM INPUT FILE
         BAL,5    BINEBC
         LCI      2
         LM,14    CNVRT
         STM,14   SRTIN+7
         M:PRINT  (MESS,SRTIN)      RECORD INTO SORT FROM INPUT FILE
*
         LI,15    0
         STW,15   CNVRT
         LW,15    BCT0+7
         STW,15   CNVRT+1           RECORDS OUTPUT FROM SORT
         BAL,5    BINEBC
         LCI      2
         LM,14    CNVRT
         STM,14   SRTOT+7
         M:PRINT  (MESS,SRTOT)
*
         LW,15    BCT0+20           NUMBER OF INSERTIONS
         BEZ      MCR20
         STW,15   CNVRT+1
         LI,15    0
         STW,15   CNVRT
         BAL,5    BINEBC
         LCI      2
         LM,14    CNVRT
         STM,14   INSCNT+7
         M:PRINT  (MESS,INSCNT)
MCR20    RES      0
         LW,15    BCT0+23            OUT INSERT COUNT
         BEZ      MCR2
         STW,15   CNVRT+1
         LI,15    0
         STW,15   CNVRT
         BAL,5    BINEBC
         LCI      2
         LM,14    CNVRT
         STM,14   OUSCNT+7
         M:PRINT  (MESS,OUSCNT)
*
MCR2     RES      0
         LW,15    BCT0+21            IN DELETES
         BEZ      MCR3
         STW,15   CNVRT+1
         LI,15    0
         STW,15   CNVRT
         BAL,5    BINEBC
         LCI      2
         LM,14    CNVRT
         STM,14   DELCNTA+7
         M:PRINT  (MESS,DELCNTA)
*
MCR3     RES      0
         LW,15    BCT0+22           OUT DELETES
         BEZ      MCR3A
         STW,15   CNVRT+1
         LI,15    0
         STW,15   CNVRT
         BAL,5    BINEBC
         LCI      2
         LM,14    CNVRT
         STM,14   DELCNTB+7
         M:PRINT  (MESS,DELCNTB)
*
MCR3A    RES      0
         M:DEVICE M:LL,(PAGE)
         B        *MCRR
*
*
*  THIS REGION TESTS AND INITIALISES FOR THE SEQUENCE CHECK OPTION
*
MFPSX    RES      0
         LW,RD    NSEQ2
         STW,RD   OCSEQ
         LW,RD    NSEQ1             NO SEQUENCE CHECK COMMAND
         LI,RE    X'10000'
         AND,RE   BCT0+8            WAS A FINAL SEQUENCE CHECK REQUESTED
         BNE      MFP1              NO:
         LW,RD    SEQU2
         STW,RD   OCSEQ
         LW,RD    SEQU1             YES:  SEQUENCE CHECK COMMAND
MFP1     STW,RD   MSWR1             STORE COMMAND INTO MERGE WRITE
*
*  THIS REGION CHECKS FOR USER SPECIFIED OUTPUT OWN CODE AND INITIALIZES
*       FOR IT
*
         LW,RE    NOWN              NO USER OWN CODE WRITE COMMAND
         LW,RD    OSO                     IS THERE AN OWN-CODE MODULE
         BEZ      MFP2              NO:
         LW,RE    OWNS              YES:  OWN CODE SPECIFIED COMMAND
MFP2     STW,RE   MOWR1             STORE INTO MWRITE SEQUENCE
*
*  THIS REGION INITIALIZES THE FCT TABLES FOR THE FINAL OUTPUT FILE
*
         LI,X1    1
         LH,X6    ILT0,X1
         LI,RE    X'FFFF'
         AND,RE   FCT0,X6
         SLS,RE   1
         STW,RE   FCT2
         LI,2     11
         LB,2     *SIN1R+1,2         CHECK FOR REMOVE
         CI,2     X'D9'
         BNE      MFP21
         M:CLOSE  *FCT2,(REL),(REM)
         B        MFP22
MFP21    RES      0
         M:CLOSE  *FCT2,(REL)
MFP22    RES      0
         LI,RE    DA(F:SORTOUT)     SET OUTPUT FILE DCB INTO
         LI,RF    X'FFFF'               ITS FCT0 SLOT
         STS,RE   FCT0,X6
         LH,RE    BCT0+2,X1
         SLS,RE   2
         STW,RE   FCT2              OUTPUT BUFFER LENGTH
         LH,RE    BCT0+4,X1
         SLS,RE   2
         AH,RE    BCT0+15,X1
         CW,RE    FCT2
         BLE      %+2
         LW,RE    FCT2
         STW,RE   FCT4              OUTPUT LOGICAL RECORD LENGTH
         B        MFP25             RETURN TO P3
*
*  THIS REGION COPIES THE SINGLE STRING ONTO THE OUTPUT FILE
*
MFP4X    RES      0
         LH,X6    ILT0,X1
         MTW,1    CCT0              SET TO 4
         LW,5     ANSISWOU
         CI,5     1                 UNDEF TREAT AN UNBLOCKED
         BE       MFP5-2
         CI,5     2
         BGE      MFP5-1            TREAT AS BLOCKED TYPES 2 AND 3
         LH,X5    BCT0+17,X1
         CI,X5    1
         BNE      %+2
         LW,X7    =C'U   '
         BAL,X5   OU1               GO OPEN FINAL OUTPUT FILE
MFP5     BAL,X5   MREAD
         CI,X7    0                 IS THIS THE END OF STRING
         BE       MFP6                YES
         LW,X5    OSO                OWN CODE              /SIG7-1883/*D4985
         BE       MFP55                NOCODE              /SIG7-1883/*D4985
* CODE DELETED
         LW,5     MFP56               MOD MEX ROUTINE      /SIG7-1883/*D4985
         STW,5    MEX3-1                                   /SIG7-1883/*D4985
         STW,5    MEX4-1                                   /SIG7-1883/*D4985
* CODE DELETED
MFP55    BAL,X5   MFPWT                                    /SIG7-1883/*D4985
MFP56    B        MFP5                                     /SIG7-1883/*D4985
*                                                          /SIG7-1883/*D4985
MFP57    B        MFP55             USED TO COME FROM MEX  /SIG7-1883/*D4985
*
MFP6     LCI      15
         STM,X1   OCSAV
         LW,X5    OSO               DOES OWN CODE EXIST    /SIG7-1883/*D4985
         BE       MFP6AA            GO AROUND  OWN CODE BR /SIG7-1883/*D4985
MFP6A    LI,X6    0                  0 FOR EOF             /SIG7-1883/*D4985
         LI,7     MFP6B             ACTION ADDR            /SIG7-1883/*D4985
         BAL,X5   *OSO              OWN CODE BRANCH        /SIG7-1883/*D4985
MFP6AA   LCI      15                                       /SIG7-1883/*D4985
         LM,X1    OCSAV             RESTORE REGS           /SIG7-1883/*D4985
         LH,X6    ILT0,X1           ORDINATE ADDR FOR CLOSE/SIG7-1883/*D4985
         BAL,X5   CO1               CLOSE OUTPUT           /SIG7-1883/*D4985
         MTW,-1   CCT0              PUT TO 3, WILL BE 4 SOON
         B        MFP3              EXIT                   /SIG7-1883/*D4985
*                                                          /SIG7-1883/*D4985
MFP6B    LB,X4    X6                 FOR ACTION REQ COMPARE/SIG7-1883/*D4985
         CI,X4    2                 : INSERT ONLY VALID REQ/SIG7-1883/*D4985
         BNE      MFP6C             NO : ERROR             /SIG7-1883/*D4985
         MTW,1    OWNCDSW
         BAL,X4   OCSEQ             CHECK SEQ OF INSERT    /SIG7-1883/*D4985
         LW,X7    X6                 ADDR OF INSERT REC    /SIG7-1883/*D4985
         LW,R0    X5                LENGTH OF INSERT REC   /SIG7-1883/*D4985
         CW,R0    FCT4              WHICH IS LONGER        /SIG7-1883/*D4985
         BLE      %+2               FCT4 IS LESS           /SIG7-1883/*D4985
         LW,R0    FCT4              USE FCT4 IT IS LONGER  /SIG7-1883/*D4985
         LI,X1    1                                        /SIG7-1883/*D4985
         LH,X6    ILT0,X1            ORDINATE              /SIG7-1883/*D4985
         BAL,X5   OB1               GO WRITE               /SIG7-1883/*D4985
         MTW,1    BCT0+23           ADD 1 TO OUT INSERT COUNT
         MTW,1    BCT0+7            ADD 1 TO OUT COUNT     /SIG7-1883/*D4985
         B        MFP6A               BACK TO USER         /SIG7-1883/*D4985
*                                                          /SIG7-1883/*D4985
MFP6C    LI,X7    9                  ILLEGAL ACTION REQ    /SIG7-1883/*D4985
         B        SC5               GO ABORT               /SIG7-1883/*D4985
*                                                          /SIG7-1883/*D4985
NOWN     BAL,X5   MSWR1
OWNS     BAL,X5   MEXOC
         PAGE
*                                                          /SIG7-6496/*F4985
MRSX     RES      0
         LW,5     ANSISWOU
         CI,5     1                 UNDEF TREAT AS UNBLOCKED
         BE       MRSA-1
         CI,5     2
         BGE      MRSA
         LH,X5    BCT0+17,X1
         CI,X5    1
         BNE      %+2
         LW,X7    =C'U   '
MRSA     BAL,5    OU1
         B        MRS1
         PAGE
MEB9X    RES      0
         LW,X5    OSO               IS THERE ANY OUTPUT OWN CODE
         BE       MEB10             NO:  BYPASS
         LCI      15
         STM,X1   OCSAV
         LI,X7    MEB11             INSERT RETURN
         LI,X6    0                 SET EOF INDICATION
         BAL,X5   *OSO              GO EXECUTE OWN CODE
         LCI      15
         LM,X1    OCSAV             RESTORE REGISTERS
MEB10    BAL,X5   CO1               GO CLOSE FINAL OUTPUT FILE
         B        MEB1
         B        MEB1
*
MEB11    LB,X4    X6                 INSERT REC ADDR       /SIG7-1883/*D4985
         CI,X4    2                 02 INSERT              /SIG7-1883/*D4985
         BNE      MEB12             ERROR                  /SIG7-1883/*D4985
         MTW,1    OWNCDSW
         BAL,X4   OCSEQ             SEQ CHECK OUTPUT INSRT /SIG7-1883/*D4985
         LW,X7    X6                PUT REC ADDR FOR WRITE /SIG7-1883/*D4985
         LW,R0    X5                INSERT REC LENGTH      /SIG7-1883/*D4985
         CW,R0    FCT4              COMP LENGTH WITH VAR L /SIG7-1883/*D4985
         BLE      %+2                USE USER LENGTH       /SIG7-1883/*D4985
         LW,R0    FCT4               USE VAR LENGTH, LONGER/SIG7-1883/*D4985
         LI,X1    1                                        /SIG7-1883/*D4985
         LH,X6    ILT0,X1            ORDINATE              /SIG7-1883/*D4985
         BAL,X5   OB1                WRITE INSERT          /SIG7-1883/*D4985
         MTW,1    BCT0+23           ADD 1 TO OUT INSERT COUNT
         MTW,1    BCT0+7            ADD 1 TO OUT COUNT     /SIG7-1883/*D4985
         B        MEB9X+4           RETURN TO USER         /SIG7-1883/*D4985
*                                                          /SIG7-1883/*D4985
MEB12    LI,X7    9                 ILL ACTION REQ         /SIG7-1883/*D4985
         B        SC5               GO ABORT               /SIG7-1883/*D4985
*                                                          /SIG7-1883/*D4985
         PAGE
*
NSEQ1    B        MSWR1+1
SEQU1    BAL,X4   OCSEQ            SEQ CHK COM
NSEQ2    B        *4
SEQU2    LCI      3
*
MWRTX    RES      0
         BAL,X5   OB1               GO WRITE RECORD
         B        *MWRITER
*
*
MSWR1X   RES      0
         CW,R0    FCT4              IS RECORD LARGER THAN MAXIMUM SIZE
         BLE      %+2               NO:  USE RECORD SIZE
         LW,R0    FCT4              YES:  USE MAXIMUM SIZE
         BAL,X5   OB1
         LI,5     0
         STW,5    MEMPROSW          DIDN'T GET IT SO CLEAR
         MTW,1    BCT0+7
MFPWT1   B        *MFPWTR
*
MEXOCT   DO1      15
         DATA     0
*
MEXINS   DATA     0,0,0
*
MEXOC    LCI      15                SAVE ALL
         STM,X1   MEXOCT                  REGISTERS
MEX0     LW,X6    BCT0+10           RECORD ADDRESS
         LH,8     *BCT0+10,1              FULL REC LEN
         SLS,8    -2                TO WORDS
         AI,8     -1                TO BEGIN OF REC
         AW,8     6                 ADD ADDR TO GET END CTL WORD
         LH,8     *8                ACTUAL REC LEN
         AND,8    =X'FFFF'
         LI,X7    MEX2              ACTION RETURN ADDRESS
         SLS,X6   2
         AI,6     8                                        /SIG7-4136/*E4985
         BAL,X5   *OSO
MEX1     LCI      15
         LM,X1    MEXOCT
         B        MSWR1
*
*  THIS REGION PROCESSES USER ACTION REQUESTS
*
MEX2     MTB,0    X6
         BNE      MEX3              NOT DELETE
*                        DELETE RECORD
         LCI      15
         LM,X1    MEXOCT            RESTORE REGISTERS
         MTW,1    BCT0+22           INCR OUT DELETE        SIG7-8751
         B        *MFPWTR
*
MEX3     MTB,15   X6
         BNE      MEX4              NOT REPLACE
*                        REPLACE RECORD
         MTW,1    OWNCDSW
         BAL,X4   OCSEQ
         LW,X7    X6                ADDRESS
         LW,R0    X5                LENGTH
         LI,X1    1
         LH,X6    ILT0,X1           FCT ORDINATE
         CW,R0    FCT4              IS LENGTH GREATER THAN MAXIMUM
         BLE      %+2               NO
         LW,R0    FCT4              YES USE MAXIMUM
         BAL,X5   OB1               GO WRITE RECORD
         MTW,1    BCT0+7            ADD 1 TO OUT CNT       /SIG7-1883/*D4985
         LCI      15
         LM,X1    MEXOCT            RESTORE REGISTERS
         B        MFPWT1
*
MEX4     MTB,15   X6
         BNE      MEXER             NOT DELETE,REPLACE,OR INSERT
         MTW,1    OWNCDSW
*                             INSERT RECORD
         BAL,X4   OCSEQ
         LW,X7    X6
         LW,R0    X5
         CW,R0    FCT4
         BLE      %+2                USE USER LENGTH       /SIG7-1883/*D4985
         LW,R0    FCT4              USE THIS LENGTH, LONGER/SIG7-1883/*D4985
         LI,X1    1                                        /SIG7-1883/*D4985
         LH,X6    ILT0,X1             ORDINATE             /SIG7-1883/*D4985
         BAL,X5   OB1                WRITE                 /SIG7-1883/*D4985
         MTW,1    BCT0+23           ADD 1 TO OUT INSERT COUNT
         MTW,1    BCT0+7            ADD 1 TO OUT COUNT     /SIG7-1883/*D4985
         B        MEX0               BACK TO USER          /SIG7-1883/*D4985
MEXER    LI,X7    9                 ILL OWN-CODE REQ       /SIG7-1162/*C4988
         B        SC5               GO ABORT               /SIG7-1162/*C4988
*
         PAGE
*
*
*
MSEQSAVE DATA     0
MSEQ3    LH,X6    ILT0,X1
         STW,5    MSEQSAVE
         LI,X7    0
         BAL,X5   CO1
         LW,5     SEQLNG            GET LENGTH             /SIG7-4174/*E4985
         SLS,5    -2                                       /SIG7-4174/*E4985
         AW,5     4                                        /SIG7-4174/*E4985
         M:SNAP 'SEQ REC1',(*4,*5)                         /SIG7-4174/*E4985
         MTW,0    OWNCDSW            ARE WE FROM OWN CD
         BEZ      MSEQ31            NO
         LW,5     OCSEQR+1          5 HAS OWN CD LEN
         AND,5    =X'3FFF'           GET LEN
         B        MSEQ32
MSEQ31   RES      0
         LW,4     BCT0+10           BYTE ADDR OF REC
         SLS,4    -2                TO WORDS
         LW,5     *4                GET CTL WD
         AND,5    =X'FFFF'           GET REC LEN
MSEQ32   RES      0
         SLS,5    -2                                       /SIG7-4174/*E4985
         LW,4     MSEQSAVE
         AW,5     MSEQSAVE
         M:SNAP   'SEQ REC2',(*4,*5)                       /SIG7-4174/*E4985
         LI,X7    15                SEQUENCE ERROR         /SIG7-1162/*C4988
         B        SC5               GO ABORT               /SIG7-1162/*C4988
*
OCSEQR   DO1      3
         DATA     0
OWNCDSW  DATA     0                 0 NO, 1 YES
OCSEQ    LCI      3
         STM,4    OCSEQR
         MTW,0    OWNCDSW
         BEZ      OCSEQ1
         STW,6    10                SAVE ADDR
OCSEQ1   LW,5     BCT0+7            0 FOR 1ST TIME
         BNEZ     OCSEQ4
         MTW,0    OWNCDSW
         BNEZ     OCSEQ2
         LW,RA    BCT0+10           GET RECORD ADDRESS FIRST TIME THROUGH
         SLS,RA   2                 BYTE ADDRESS
OCSEQ2   RES      0
         AND,10   =X'FFFFF'          JUST BYTE REC ADDR
         LW,11    SEQRCD            HOLD AREA FOR PREV REC
         MTW,0    OWNCDSW
         BEZ      OCSEQ3
         LW,12    OCSEQR+1          FOR OWN CD 5 HAS LEN
         AND,12   =X'3FFF'          GET LEN
         AI,11    +8                UP HOLD AREA ADDR BY 2 CTL WORDS
         B        OCSEQ31
OCSEQ3   RES      0
         SLS,10   -2                TO WORDS
         LW,12    *10               GET CTL WD
         SLS,10   2                 TO BYTES
         AND,12   =X'FFFF'
OCSEQ31  RES      0
         BAL,9    RWMOV             MOVE REC TO HOLD AREA
         LCI      3
         LM,4     OCSEQR
         MTW,0    OWNCDSW
         BEZ      %+2
         MTW,-1   OWNCDSW           SET OFF
         B        *4                 EXIT
* NOT 1ST TIME, WILL COMP THEN STORE SEQRCD FOR NEXT
OCSEQ4   LW,4     SEQRCD            HOLD AREA FOR PREV REC
         MTW,0    OWNCDSW
         BEZ      OCSEQ5
         LW,5     6                 ACTION REC ADDR (OWN/CD)(BYTE)
         SLS,5    -2
         AI,5     -2                MAKE 2 PSEUDO CTL WORDS
         B        %+2
OCSEQ5   LW,5     BCT0+10           CURR REC ADDR BYTE
         SLS,4    -2                SEQRCD TO BYTES
         AND,5    =X'FFFFF'         STRIP ACTION CODE IF ANY
         LI,1     1
         LW,9     STOPCMPA
         XW,9     *COMSTOPA
         STW,9    STOPCMPA
         LW,9     STOPCMPD
         XW,9     *COMSTOPD
         STW,9    STOPCMPD
         BAL,9    *MRGSEL            COMP REC ON KEYS
         BCS,1    MSEQ3             SEQ ERROR ABORT
         LW,9     STOPCMPA
         XW,9     *COMSTOPA
         STW,9    STOPCMPA
         LW,9     STOPCMPD
         XW,9     *COMSTOPD
         STW,9    STOPCMPD
         MTW,0    OWNCDSW
         BEZ      OCSEQ6
         LW,10    OCSEQR+2          GET SAVED R6, REC ADDR
         B        OCSEQ2
OCSEQ6   LW,10    BCT0+10            CURR REC ADDR
         SLS,RA   2                  BYTE ADDRESS
         B        OCSEQ2
         PAGE
*
MREADX   RES      0
         BAL,X5   SD1               READ NEXT INPUT RECORD
         B        MREAD0            RETURN TO P3
*
*
         PAGE
*
OPCLSX   RES      0
         LH,X7    BCT0              OUTPUT FILE DCB ADDRESS
         AND,7    =X'FFFF'                                 /SIG7-4980/*F4985
         LH,X6    ILT0,X1           OUTPUT FCT ORDINATE
         STW,X7   FCT0,X6
         LH,X7    BCT0+2,X1         PHYSICAL RECORD LENGTH FOR THE
         STW,X7   FCT2                  OUTPUT FILE
         LH,X7    BCT0+4,X1         LOGICAL RECORD LENGTH FOR THE
         STW,X7   FCT4                  OUTPUT FILE
         LW,5     ANSISWOU
         CI,5     1
         BE       OPC1-1
         CI,5     2
         BGE      OPC2
         CW,X7    FCT2
         BNE      OPC2
         LW,X7    =C'UVF '
OPC1     BAL,X5   OU1               GO OPEN FINAL OUTPUT FILE
         B        OPC3
         LI,X7    13                ALREADY OPEN           /SIG7-1162/*C4988
         B        SC5               GO AOBRT               /SIG7-1162/*C4988
*
OPC2     LW,X7    =C'BFF '
         B        OPC1
*
OPC3     LI,X7    0
         BAL,X5   CO1
ENDP31   RES      0
         B        *OPCLSR
*
         PAGE
*
         END

