         SYSTEM   SIG6
         SYSTEM   BPM
*
*    MODULE   E1
*
         DEF      MRGS10X,SRTFX,SRT:FINX
         REF      MRGS15,PHS15
         REF      FIT0,FIT1,FIT2,FIT3,FIT4,FIT5,FIT6,INEOF,ILT0
         REF      BINEBC,RRN0,E1R,CO1
         REF      ILT2,RCDLN,RCDAD,BCT0,MTC0,MTC1,MTC2,MTC3,CNVRT
         REF      MEMPROSW
         REF      COMPR,S:OUT,TRKSB,OU1,WTERR,WTABN,RDERR,RDABN
         REF      ENDSNAP
BINBCD   EQU      BINEBC
*
         PAGE
SRTFX    RES      0
         LI,15    ENDP31
         STW,15   ENDSNAP
         BAL,15   OU1               OPEN OUT FILE
         B        PHS15            RETURN TO CALLER
*
SRT:FINX RES      0
         BAL,11   S:OUT            SHOW EOF
         LI,7     0                 EOF FLAG
         BAL,15   CO1               CLOSE OUTPUT
         LW,15    BCT0+5
         STW,15   CNVRT+1
         LI,15    0
         STW,15   CNVRT
         BAL,5    BINBCD
         LCI      2
         LM,14    CNVRT
         STM,14   TRNSIZ+7          TOURNAMENT SIZE
         M:PRINT  (MESS,TRNSIZ)
         LW,15    FIT4
         STW,15   CNVRT+1
         LI,15    0
         STW,15   CNVRT
         BAL,5    BINBCD
         LCI      2
         LM,14    CNVRT
         STM,14   BUFNUM+7          NUMBER OF BUFFERS AVAILABLE
         M:PRINT  (MESS,BUFNUM)
         LW,15    TRKSB
         STW,15   CNVRT+1
         LI,15    0
         STW,15   CNVRT
         BAL,5    BINBCD
         LCI      2
         LM,14    CNVRT
         STM,14   BUFSIZ+7          BUFFER SIZE IN BYTES
         M:PRINT  (MESS,BUFSIZ)
         MTW,-1   BCT0+1            MAKE CNT ACTUAL
         LW,15    BCT0+1
         STW,15   CNVRT+1
SRTF10   RES      0                   SIDR NR. 8
         LI,15    0
         STW,15   CNVRT
         BAL,5    BINBCD
         LCI      2
         LM,14    CNVRT
         STM,14   SRTIN+7
         M:PRINT  (MESS,SRTIN)
         LW,15    BCT0+2
         STW,15   CNVRT+1
         LI,15    0
         STW,15   CNVRT
         BAL,5    BINBCD
         LCI      2
         LM,14    CNVRT
         STM,14   SRTOT+7
         M:PRINT  (MESS,SRTOT)
         LW,15    BCT0+20           INSERTED RECORD COUNT
         BEZ      PHS41
         STW,15   CNVRT+1
         LI,15    0
         STW,15   CNVRT
         BAL,5    BINBCD
         LCI      2
         LM,14    CNVRT
         STM,14   INSCNT+7
         M:PRINT  (MESS,INSCNT)
PHS41    RES      0
         LW,15    BCT0+31            OUT INSERT COUNT
         BEZ      PHS50
         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)
PHS50    RES      0
*
         LW,15    BCT0+21            IN DELETES
         BEZ      PHS51
         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)
*
PHS51    RES      0
         LW,15    BCT0+22           OUT DELETES
         BEZ      PHS60
         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)
*
PHS60    RES      0
         B        E1R              EXIT
*
*
*                                     SIDR NR. 8
SRTIN    TEXTC    'RECORDS INPUT:                     '
SRTOT    TEXTC    'RECORDS OUTPUT:                    '
TRNSIZ   TEXTC    'RECORDS IN TOURNAMENT:             '
BUFNUM   TEXTC    'NUMBER OF MERGE BUFFERS:           '
BUFSIZ   TEXTC    'INTERMEDIATE BUFFER SIZE:          '
INSCNT   TEXTC    'RECORDS INSERTED IN:               '
OUSCNT   TEXTC    'RECORDS INSERTED OUT:              '
DELCNTA  TEXTC    'RECORDS DELETED IN:                '
DELCNTB  TEXTC    'RECORDS DELETED OUT:               '
MRGS10X  RES      0
         MTH,0    BCT0+29,1         DOES USER WANT OUT REC SIZE
         BEZ      MRGS13            NO
         STW,8    11                 ACTUAL RECORD SIZE
         LH,8     BCT0+24,1          OUT REC LEN IN WORDS
         SLS,8    2                 TO BYTES
         AH,8     BCT0+25,1          ADD BYTE INCR
         CW,8     11                IS OUT LEN GREATER THAN ACTUAL SIZE
         BLE      %+2                NO
         MTW,1    MEMPROSW          YES, POSS ABORT IF AT END OF MEM
MRGS13   RES      0
         BAL,11   S:OUT
         MTW,-1   MEMPROSW          MADE IT SO SET OFF
ENDP31   RES      0
         B        MRGS15           RETURN TO CO-RES P3
         PAGE
         END

