         SYSTEM   SIG7FDP
         TITLE    'PHASE 4.1 - SORT,REPORT'
* READ PROC                                                             APR
* LF     R---     R-,+/-HW OFFSET,INDIRECT ADDR.                        APR  1
RCEF     CNAME    0                                                     APR00
RECF     CNAME    1                                                     APR01
RCRF     CNAME    2                                                     APR02
         PROC                                                           APR04
         DO       NAME>1                                                APR10
LF       BAL,L1   AAC00             READ CRF CLUSTER                    APR11
         ELSE                                                           APR12
         DO       NAME                                                  APR13
LF       BAL,L1   AAE00             READ ECF CLUSTER                    APR14
         ELSE                                                           APR15
LF       BAL,L1   *AF(3)            READ CRF/ECF CLUSTER                APR16
         FIN                                                            APR17
         FIN                                                            APR18
         DO       NUM(AF(1))                                            APR30
         LW,AF(1) R2                LOAD HA(CLOC)+/- HW OFFSET          APR31
         DO       NUM(AF(2))                                            APR40
         AI,AF(1) AF(2)                                                 APR41
         ELSE                                                           APR42
         AI,AF(1) 1                                                     APR43
         FIN                                                            APR44
         FIN                                                            APR44
         PEND                                                           APR50
* WRITE PROC                                                            APW
* LF     W---     R-,BA(CLOC)+/-BA OFFSET,RETURN                        APW 1
WPOF     CNAME    0                                                     APW00
WMCF     CNAME    1                                                     APW01
         PROC                                                           APW03
         DO       NUM(AF(2))                                            APW11
LF       LI,R4    AF(2)             LOAD BA(CLOC)                       APW12
         ELSE                                                           APW13
         DO       NUM(AF(1))                                            APW132
LF       LW,R4    AF(1)             LOAD,SET HA(CLOC) TO BA             APW14
         AW,R4    R4                                                    APW15
         FIN                                                            APW16
         FIN                                                            APW17
         DO       NAME                                                  APW80
         DO       NUM(AF(4))
         B        WRMCF             WRITE MCF CLUSTER
         ELSE
         DO       NUM(AF(3))
         LI,L1    AF(3)             LOAD LINK REGISTER
         B        WRMCF             TO WRITE MCF CLUSTER
         ELSE                                                           APW812
         BAL,L1   WRMCF             WRITE MCF CLUSTER                   APW813
         FIN                                                            APW814
         FIN                                                            APW818
         ELSE                                                           APW82
         DO       NUM(AF(4))
         B        WRPOF             WRITE POF CLUSTER
         ELSE
         DO       NUM(AF(3))
         LI,L1    AF(3)             LOAD LINK REGISTER
         B        WRPOF             TO WRITE POF CLUSTER
         ELSE                                                           APW842
         BAL,L1   WRPOF             WRITE POF CLUSTER                   APW843
         FIN                                                            APW844
         FIN                                                            APW848
         FIN                                                            APW85
         PEND                                                           APW90
* DIAG PROC                                                             APD
DX       CNAME                                                          APD00
         PROC                                                           APD01
* AF     DX       DIAG CODE,LINK                                        APD02
LF       LI,R1    AF(1)             LOAD DIAG CODE                      APD10
         DO       NUM(AF(3))
         B        DIAG              WRITE DMF CLUSTER
         ELSE
         DO       NUM(AF(2))
         LI,L1    AF(2)             LOAD LINK REGISTER
         B        DIAG              WRITE DMF CLUSTER                   APD242
         ELSE                                                           APD243
         BAL,L1   DIAG              WRITE DMF CLUSTER                   APD244
         FIN                                                            APD248
         FIN                                                            APD29
         PEND                                                           APD40
* LINK(OR LOAD) AND BRANCH PROC                                         APL
* LF     LAB,L/R  BRANCH ADDRESS,LINK ADDRESS(OR LOAD VALUE)            APL  1
LAB      CNAME                                                          APL01
         PROC                                                           APL04
LF       LI,CF(2) AF(2)             SET LINK REGISTER                   APL12
         B        AF(1)             BRANCH                              APL14
         PEND                                                           APL90
*                                                                       AA0
         REF      WRMCF             WRITE MCF CLUSTER
         REF      WRPOF
         REF      DIAG              WRITE DMF CLUSTER
         REF      AAC00             READ CRF
         REF      AA00
         REF      AA01,AA02,AA03    M.C. RETURNS
         REF      AA092
         REF      AA20
         REF      AA80,AA84
         REF      PIA06
         REF      PIX02,PIX06
         REF      ADO00,ADO10,ADO30,ADO50
         REF      ADI00,ADI02
         REF      ABP01,ABP20
         REF      ABO02,ABQ10
         REF      ABW00,ABR00
         REF      STBAS
         REF      JAKON             CONSTANTS
         REF      JADAT             DATA
         REF      JASAV             SAVE AREA
         REF      JAMOD             MODEL CLUSTERS,BUFFER
         REF      MAIOC
         REF      JMCRD             SORT SWITCH
         REF      PDBS              NO. OF BYTES FOR BASE 4(HALF-WORD)
         REF      PDBZ
         REF      PDBJ                                                  COBOL41J
         REF      PIL06                                                 COBOL41J
         REF      PIA02                                                 COBOL41J
         REF      PID10                                                 COBOL41J
         REF      PID11,PIL20                                           COBOL41J
         REF      SRTPG                                                 COBOL41J
XFS      EQU      148                                                   COBOL41J
CRR5     EQU      X'50'                                                 COBOL41J
CRR6     EQU      X'60'                                                 COBOL41J
CRR14    EQU      X'E0'                                                 COBOL41J
CBRCH    EQU      X'6800'                                               COBOL41J
         REF      ADV00,ADS00
* REGISTER EQUIVALENCES
R0       EQU      0
R1       EQU      1
R2       EQU      2
R3       EQU      3
R4       EQU      4
R5       EQU      5
R6       EQU      6                                                     117
R7       EQU      7                                                     116
V0       EQU      8
V1       EQU      9
V2       EQU      10
L0       EQU      V2                                                    1212
L1       EQU      11                LINK REGISTER
D0       EQU      12                DECA
D1       EQU      13
D2       EQU      14
D3       EQU      15
* DIAG CODE BASE EQUIVALENCES
XCAS     EQU      186
*
DACB     EQU      X'0CCD'           MCF CLNG,CNTL
DADA     EQU      X'052D'           AN
DFCOS    EQU      X'801'            OUTSORT LABEL FLAG
CSI      EQU      -5                SORT SWITCH SETTING
CLOP     EQU      X'80'             LAST OP FLAG
CCASI    EQU      X'1000'           SORT INPUT PROCEDURE
CCASO    EQU      X'800'            SORT OUTPUT PROCEDURE
IBCS     EQU      X'9000'           KEY REF CNTL
IPCB     EQU      X'262'            PREF CNTL
* OP CODE,REGISTER
CLI      EQU      X'2200'
CRR2     EQU      X'20'
         TITLE    'PHASE 4.1 - SORT'
         DEF      ACA00             RELEASE
         DEF      ACB00             SORT
         DEF      ACC00             RETURN
         DEF      ACB52,ACB54,ACB60,ACB70
         DEF      SORTFG,SRTOC      SORT FLAG, SRT FILE OPEN/CLOSE      COBOL41J
*
* RELEASE                           TYPE = X'63'                        ACA
ACA00    RES      0                                                     ACA00
         LW,R1    PDBJ             CHECK IF CO-RES SORT                 COBOL41J
         CI,R1    3
         BAZ      %+2                NOT CO-RES SORT                    COBOL41J
         BAL,L1   ACC85             WRITE SPECIAL MCF                   COBOL41J
         BAL,L1   ADS00             SAVE VAR REC PARAM                  COBOL41J
         BAL,L1   ADS00             SAVE VAR REC PARAM
         LI,V1    CCASI+X'400'      LOAD INPUT/E-O-INPUT PROC. FLAG
         LI,L1    ABW00             SET LINK REGISTER
*                        L1 = LINK REGISTER
ACA02    RES      0
         MTW,1     JDOID            SET DDB I.D. FOR SDB
         CH,V1    JSTYP             CHECK SECTION REF TYPE
         BANZ      *L1              INPUT/OUTPUT PROCEDURE
* S*****RELEASE/RETURN NOT IN SORT INPUT/OUTPUT PROCEDURE***
ACA04    RES      0
         DX        XCAS,,0          WRITE DMF CLUSTER
* SORT                              TYPE = X'68'                        ACB
ACB00    RES      0                                                     ACB00
         LH,V1    JSTYP             LOAD,CHECK SEC TYPE
         CI,V1     CCASI+CCASO+X'400'
         BAZ      ACB04             NOT INPUT/OUTPUT PROCEDURE
* S*****SORT IN INPUT/OUTPUT PROCEDURE***
         LAB,R1   AA092,XCAS+1      WRITE DMF CLUSTER
ACB04    RES      0
         LW,R4    PDBJ              GET OPTION FLAG                     COBOL41J
         CI,R4    3                 IS CO-RES SORT ?                    COBOL41J
         BANZ     ACB045            JUMP IF YES                         COBOL41J
         LI,V1    0                 INDICATE NON-RES SORT BEGIN         COBOL41J
         STW,V1   SORTFG            SET SORT BEGIN INDICATOR            COBOL41J
ACB045   MTW,1    JDOID             SET FOR SDB                         COBOL41J
         BAL,L0   ADO00             CHECK SFREF
* *** FILE-NAME-1 DDB I.D. = 01 ?? **********
         B        AA02              INVALID SFREF
* VALID SFREF
*                        R7 = WA(DDB)
*                        D0 = FILE STATS
*                        D3 = DCB BASE NO.
         LW,V1    MAIOC+1           SAVE SORTIN DDB OFFSET
         STD,V1   MAIOC+6           *  (OUTSORT = SORTIN)
         STD,D3   MAIOC+8           SAVE DCB BASE(OUTSORT = SORTIN)
         LB,D3    D3                DDB NO. TO RECORD BASE NO.
         AI,D3    -100
* *** RECORD BASE NO. = DCB BASE-100 ***
         STB,D3   R7                SAVE BASE NO.
         STD,R7   JCBDI             SAVE WA(DDB) (OUTSORT = SORTIN)
         LI,R6    X'FF'            MASK FOR FIELD D OF DDB              COBOL41J
         AND,R6   0,R7             LOAD FIELD D OF DDB                  COBOL41J
         CI,R6    X'80'            WAS INSN SPECIFIED                   COBOL41J
         BANZ     ACB05             NO--DEFAULT TO 8 WORK FILES         COBOL41J
         CLM,R6   SRTINSN          COMPARE WITH SORT LIMITS             COBOL41J
         BCS,9    ACB05            DEFAULT TO 8 WORK FILES (BLNK=8)     COBOL41J
         AI,R6    X'F0'            MAKE NUMBER DISPLAY                  COBOL41J
         CI,R6    X'F9'            IS NO GREATER THAN 9                 COBOL41J
         BLE      %+2              NO                                   COBOL41J
         AI,R6    -X'39'           CHANGE TO A THRU H                   COBOL41J
         STB,R6   SAVWK            SAVE NO OF WORK FILES                COBOL41J
         B        ACB06                                                 COBOL41J
ACB05    RES      0                                                     COBOL41J
         LI,R6    X'40'             DEFAULT TO BLANK (= 8 WORK FILES)   COBOL41J
         STB,R6   SAVWK             STORE                               COBOL41J
ACB06    RES      0                                                     COBOL41J
         LI,R6    X'F0F0'           INITIALIZE KEY COUNT(KEYC)
         LI,R7    BA(STBAS)+50      SET BA(KEY LOC)(KEYL)
         STD,R6   JCBKC             SAVE KEYC,KEYL
         LI,D3    X'41C00'          SET BYTE FOR BIN DATA,ASCENDING
         STW,D3   JBPXN
* SORT KEY
*                        R3 = HA(STBAS)
ACB10    RES      0
         LI,V2    IBCS              LOAD KEY REF CNTL
         BAL,L1   ADI00             CHECK SORT KEY
         B        ACB20             INVALID SORT KEY
         LH,V0    2,R5              LOAD,CHECK BASE NO.
         SLS,V0   -8
         CB,V0    JCBDI
         BE       ACB12             =, VALID KEY
* S*****KEY NOT IN SORT FILE********
         DX       XCAS+2,ACB20      WRITE DMF CLUSTER
* VALID SORT KEY
ACB12    RES      0
         MTW,1    JCBKC             KEYC = KEYC+1
         LW,R3    JCBKL             LOAD KEYL(I)
*                        R7 = STMT OPTION
         LW,D3    JBPXN             LOAD A/D BIN DATA CONSTANT
         CI,R7    6                 CHECK A/D OPTION BITS
         BAZ      ACB13             DOWN. USE OLD OPTION
* A/D OPTION GIVEN
         LI,D3    X'41C00'          SET BYTE FOR BIN DATA,ASCENDING
         CI,R7    2                 CHECK A FLAG
         BANZ     ACB13-1           UP. ASCENDING
* DESCENDING
         AI,D3    X'3000'           SET FOR D
         STW,D3   JBPXN             SAVE A/D BIN DATA CONSTANT
ACB13    RES      0
         CI,R6    X'20004'          CHECK DATA TYPE
         BG       ACB16             INDEX/BIN/FLL/FLS DATA
         LI,R5    C'P'              LOAD PACKED DECIMAL CHAR.
* *** LI DOES AFFECT C1/C2*******************
         BAZ      ACB14             NC DATA
         LI,R5    C'A'              LOAD AN DATA TYPE CHAR.
         CI,R6    1                 CHECK DATA TYPE
         BL       ACB14             < 0, GRP/AN
* *** NDU/NDS TEST UNNECESSARY ******
         LI,R5    C'Z'              NDS, LOAD ZONED DATA CHAR.
ACB14    RES      0
         LH,V0    3,R4              LOAD,CONVERT BSIZ KEY(I)
         CI,V0    255
         BLE      ACB15
         DX       179
         LI,V0    255
ACB15    RES      0
         CVS,V0   K3VAL-16
         STH,V1   D3                STORE CONVERTED BSIZ
         B        ACB18
* BIN/INDEX/FLP DATA
ACB16    RES      0
         LI,R5    C'B'              LOAD BINARY DATA TYPE CHAR.
         CI,R6    X'30000'          CHECK DATA CLASS
         BG       ACB18             BIN/INDEX/FLS DATA
* FLL DATA
         AI,D3    X'40000'          SET BSIZ = 8
ACB18    RES      0
         LH,D0    2,R4              LOAD,CONVERT OFFSET KEY(I)
         AI,D0    1
         CVS,D0   K3VAL-16
* *** DISPL MUST BE < X'270F'(=10**4-1)***
         SLS,D3   4                 POSITION SIGN,BSIZ
         LW,D2    D1                LOAD CONVERTED DISPL
         SLD,D2   -12               POSITION DISPL,BSIZ
*
         UNPK,5   0,R3              OFFSET,BSIZ TO KEY(I)
*                        R5 = DATA TYPE CHAR.
         STB,R5   0,R3              STORE DATA TYPE CHAR.
         AI,R3    1                 KEYL(I) = KEYL(I)+1
         LI,V0    C' '              CLEAR.(=SPACE) TO TRANSLATE
         STB,V0   2,R3
*
         AI,R3    9                 UPDATE KEYL(I)
         STW,R3   JCBKL
*
ACB20    RES      0
         LI,R3    HA(STBAS)         RESET HA(STKTOP)
         CI,R2    0                 CHECK NLOC
         BNEZ     ACB22             NOT= 0, NEXT CLUSTER READ
         RCRF                       READ NEXT CLUSTER
*                        R2 = HA(NLOC)
ACB22    RES      0
         LW,R5    R2                LOAD HA(NLOC)+1
         AI,R5    1
*                        R5 = HA(NLOC)+1
         LH,R6    0,R5              LOAD,CHECK OPTION
         CI,R6    X'79'             CHECK OPTION
         BAZ      ACB10             SORT KEY
* NOT SORT KEY
ACB40    RES      0
         LW,V1    JCBKC             LOAD KEYC
         CI,V1    X'F0F0'           CHECK KEYC
         BGZ      ACB42             > 0, KEYS GIVEN
* S*****NO SORT KEYS****************
         LAB,R1   AA092,XCAS+3      WRITE DMF CLUSTER
ACB42    RES      0
         LW,V2    JCBKL             COMPUTE BSIZ SORTING PARAMETERS
         SW,V2    KBASTK
         CI,V1    X'F0F9'           CHECK KEYC
         BLE      ACB44             </= 9
         AI,V1    X'F6'             KEYC TO BASE 10
         CI,V1    X'F1F6'           CHECK KEYC FOR MAX.(=6)
         BLE      ACB44             KEYC </= MAX.
* S*****EXCESSIVE SORT KEYS ********
         DX       XCAS+4            WRITE DMF CLUSTER
         LI,V1    X'F1F6'           KEYC = MAX.
         LI,V2    210               BSIZ = MAX.(16*10+50)
ACB44    RES      0
         STH,V1   STBAS+12          STORE KEYC
         STW,V2   MAIOC+10          SAVE BSIZ SORTING PARAMETERS
*
         LI,R3    HA(STBAS)+60      RESET HA(STKTOP)
         MTW,CSI  JMCRD             SET OPEN SORTIN SWITCH
         LW,R7    PDBJ              CHECK SORT OPTION                   COBOL41J
         CI,R7    3
         BANZ     ACC10             YES. CO-RESIDENT SORT               COBOL41J
*                        R6 = OPTION
         CI,R6    X'10'             CHECK OPTION
         BAZ      ACB50             NOT USING. MUST BE INPUT PROCEDURE.
ACB45    RES      0                                                     COBOL41J
* USING
         LH,R7    1,R2              LOAD DDB NO.
         BAL,L0   ADO00             CHECK USING FILE
         B        AA00              INVALID USING FILE
* VALID USING FILE
         STW,R7   JCBDI             SAVE WA(DDB)                        COBOL41J
ACB46    RES      0                                                     COBOL41J
         LW,V1    MAIOC+1           SAVE SORTIN DDB OFFSET
         AI,V1    X'10000'          RAISE USING FLAG
         STW,V1   MAIOC+6
         STW,D3   MAIOC+8           SAVE DCB BASE
*
         LI,R1    1                 SET INPUT  MODE IN FILE HISTORY WORD
         STS,R1   1,R7                FOR GENERATING INSNS  IN COBOL51
         LW,R1    CRSF              CHECK FOR CRS                       COBOL41J
         BNEZ     ACB60             YES.  BRANCH AROUNT DECLARATIVES    COBOL41J
*
         LW,R1    6,R7              LOAD,CHECK INPUT LABEL DECLA. FLAGS
         CI,R1    X'10001'
         BAZ      ACB60             DOWN. NO INPUT LABEL CHECK.
* DECLARATIVE - LABELLED
         MTW,15   JMCRD             SET OPEN INPUT SORTIN SWITCH
         LI,R6    CLOP              SET OPEN INPUT OPTION
         B        ABO02             OPEN INPUT SORTIN
* INPUT PROCEDURE
ACB50    RES      0
         LI,R6    CLOP+1            SET OPEN OUTPUT OPTION
         LW,R7    JCBDO             LOAD WA(DDB) OUTSORT/SORTIN(=)
ACB51    RES      0
         LAB,L0   ADO50,ABO02-1     OPEN OUTPUT SORTIN/INPUT OUTSORT
* *** OPEN RETURN
*                        R5 = HA(CLOC)+1
ACB52    RES      0
         MTW,15   JMCRD             SET OPEN INPUT SORTIN SWITCH
         LI,V0    IPCB              LOAD PREF CNTL
         LH,R6    0,R5              LOAD INPUT/OUTPUT PROCEDURE OPTION
         BAL,L1   ABP01             PROCESS 'PERFORM'
         BAL,L0   ABP20             WRITE PERFORM LINKAGE
*                                                                       COBOL41J
         LW,R7    CRSF              CHECK IF CRS                        COBOL41J
         BEZ      ACB54-1           NOT CRS                             COBOL41J
         LW,R7    IPPF              INPUT PROCEDURE PERFORM FLAG        COBOL41J
         BNEZ     ACB53                                                 COBOL41J
         MTW,1    IPPF              SET FLAG                            COBOL41J
         BAL,L1   PIA06                                                 COBOL41J
         LI,R6    0                 LI,R6   0                           COBOL41J
         BAL,L1   PIX06                                                 COBOL41J
         TEXT     ':WSR'            BAL,11   C:WSR                      COBOL41J
         LI,D3    36                                                    COBOL41J
         LW,V0    CRSIO                                                 COBOL41J
         CI,V0    2                                                     COBOL41J
         BE       %+2                                                   COBOL41J
         AI,D3    2                                                     COBOL41J
         LI,V0    CBRCH                                                 COBOL41J
         BAL,L1   PIL20             B   %+36 OR 38                      COBOL41J
         B        ACB54-1                                               COBOL41J
*                                                                       COBOL41J
ACB53    RES      0                                                     COBOL41J
         BAL,L1   PIA06                                                 COBOL41J
         LI,R7    512                                                   COBOL41J
         BAL,L1   ACC25             GEN LI,6 I:FILE               29174 COBOL41J
         BAL,L1   PIX06                                                 COBOL41J
         TEXT     ':RSR'                                                COBOL41J
         BAL,L1   PIL06                                                 COBOL41J
         B        4                 B   %+4                             COBOL41J
         LW,R7    JCBDO             LOAD WA(DDB) OUTSORT/SORTIN(=)
* CLOSE  SORTIN
*                        R7 = WA(DDB)
ACB54    RES      0
         MTW,15   JMCRD             SET CLOSE SORTIN SWITCH
         LI,R6    CLOP              SET CLOSE SORTIN OPTION
         LAB,L0   ADO50,ABQ10-1     CLOSE SORTIN/OUTSORT
*
ACB60    RES      0
         LI,L1    AA01+CSI-3        SET OPEN OUTPUT OUTSORT SWITCH
         STW,L1   JMCRD
*                        R2 = HA(NLOC)
         LW,R5    R2                LOAD HA(NLOC)+1
         AI,R5    1
         LH,R6    0,R5              LOAD,CHECK OPTION
         CI,R6    X'20'
         BANZ     ACB64             OUTPUT PROCEDURE FLAG UP
* GIVING FILE
         LH,R7    1,R2              LOAD DDB NO.
         BAL,L0   ADO10             CHECK GIVING FILE
         B        AA00
* VALID GIVING FILE
ACB61    RES      0                                                     COBOL41J
         LW,V1    MAIOC+1           SAVE OUTSORT DDB OFFSET
         AI,V1    X'20000'          RAISE GIVING FLAG
         STW,V1   MAIOC+7
         STW,D3   MAIOC+9           SAVE OUTSORT DCB BASE
         STW,R7   JCBDO             SAVE WA(DDB) OUTSORT
*
         LI,R1    2                 SET OUTPUT MODE IN FILE HISTORY WORD
         STS,R1   1,R7                FOR GENERATING OUTSNS IN COBOL51
         LW,R1    CRSIO                                                 COBOL41J
         CI,R1    2                                                     COBOL41J
         BANZ     ACB70             CRS.  BRANCH AROUND DECLARATIVES    COBOL41J
*
*                        R7 = WA(DDB)
ACB62    RES      0
         LW,R1    6,R7              LOAD,CHECK OUTPUT LABEL DECLA. FLAGS
         CI,R1    X'20002'
         BAZ      ACB70             DOWN. NO OUTPUT LABEL CHECK.
* DECLARATIVE
         LI,R6    CLOP+DFCOS        SET OPEN OUTSORT OPTION
         B        ACB51             OPEN OUTPUT OUTSORT
*
ACB64    RES      0
         LW,R7    JCBDO             LOAD WA(DDB) OUTSORT
* *** MAIOC IS SET FOR OUTSORT(SORTIN=OUTSORT IF NO GIVING)************
         LW,D0    1,R7              LOAD FILE STATS.
         B        ACB62             CHECK FOR LABEL DECLA.
*
*                        R7 =WA(DDB)OUTSORT
*                        D0 = OUTSORT FILE STATS
ACB70    RES      0
         LW,R1    KCBFIL            LOAD FILL CONSTANT
         MBS,0    BA(K3VAL)+3       FILL PARAMETER LIST
* ***                       = X'40'(=SPACE)
         LI,V2    C'M'              LOAD MONITOR FILE FLAG
         CI,D0    X'8000'           CHECK LABEL FLAG
         BAZ      ACB71             DOWN. NOT LABELLED
* OUTSORT LABELLED
         STB,V2   MAIOC+6           RAISE OUTSORT LABELLED FLAG
ACB71    RES      0
         LI,R1    3                 SET INDEX
         LI,D3    X'1001C'          SET BLDOCKING FACTORS = 1
         LI,L1    ACB78             SET LINK REGISTER
ACB74    RES      0
         LW,D0    2,R7              LOAD RECORD LNG
         LH,D2    D0                LOAD,CHECK BLOCK CONTAINS
         BEZ      *L1,R1            = 0, NOT FOREIGN.
* FOREIGN FILE
         LI,V2    C'U'              LOAD USER FORMAT IND.
         LH,D1    *R7               CHECK BLOCK CONTAINS CHAR. FLAG
         CI,D1    4
         BAZ      ACB76             DOWN. CONTAINS RECORDS
* BLOCK CONTAINS CHARACTERS
         DH,D2    D0-1,R1           RECORDS = CHAR.(=BYTES)/RECORD LNG
ACB76    RES      0
         XW,D2    D0                BLOCK SIZE TO CONVERT REGISTER
         CVS,D0   K3VAL-16          CONVERT BLOCK CONTAINS VALUE
         B        *L1               RETURN
ACB78    RES      0
* FOREIGN FILE
*                        D1 = OUTBLOCKING
         SLS,D1   4                 POSITION OUTBLOCKING
         AI,D1    X'1000C'          SET DEFAULT INBLOCKING,SIGN
         LW,D3    D1
*                        D3 = DEFAULT INBLOCKING,OUTBLOCKING
         LW,R7    JCBDI             LOAD SORTIN WA(DDB)
         LW,V0    0,R7              LOAD FILE STATS                     COBOL41J
         CI,V0    X'20000'          CHECK LABEL FLAG                    COBOL41J
         BAZ      ACB80             DOWN. SORTIN NOT LABELLED.
* SORTIN LABELLED
         LI,V1    C'Y'              USER HEADER FLAG = 'Y'
         STB,V1   STBAS+3
*
ACB80    RES      0
         BAL,L1   ACB74             CHECK,CONVERT BLOCK CONTAINS
* FOREIGN FILE
*                        D0 = 0(CVS)
*                        D1 = INBLOCKING
*                        D2 = RECORD LNG
         STH,D1   D3                STORE INBLOCKING
         STH,D0   D2                CLEAR RECORD CONTAINS
         LW,D0    D2                RECORD LNG TO CONVERT REGISTER
*                        D0 = RECORD LNG
*                        D3 = IN,OUT BLOCKING
         CVS,D0   K3VAL-16          CONVERT RECORD LNG
         LW,D2    D1                POSITION RECORD LNG,BLOCKING FACTORS
         SLS,D3   4
         SLD,D2   -4
         UNPK,6   STBAS             UNPACK RECORD LNG,BLOCKING FACTORS
         STB,V2   STBAS             STORE FILE TYPE
* FORMAT SORTING PARAMETER ADCON
         LW,V2    MAIOC+10          LOAD BSIZ SORTING PARAMETERS
         LH,V1    PDBS              LOAD,SAVE, GLOBAL LITTOP
         STH,V1   MAIOC+10
         LI,R1    X'400'            SET BASE NO.
         STH,R1   V1
         AW,V1    V2                UPDATE GLOBAL LITTOP
         STH,V1   PDBS
         SW,V1    V2
         LI,V0    DADA-X'100'       LOAD AN DATA CLNG,CNTL
         SLD,V0   8                 POSITION CLNG,CNTL,ADCON NO.
         AW,V1    V2                INSERT BSIZ SORT PARAMETERS(BSIZP)
         SLS,V2   15                BSIZP TO HSIZX2**16(=CLNG ADJ.)
         AW,V0    V2                CLNG = CLNG+CLNG ADJ.
         STD,V0   STBAS-2           STORE CLNG,CNTL,ADCON NO. BSIZP
         LI,R1    39                                                    COBOL41J
         LB,V2    SAVWK             NO OF WORK FILES                    COBOL41J
         STB,V2   STBAS,R1          STORE IN PARAMETER LIST             COBOL41J
         LW,D2    SRTPG             PICK UP NUMBER OF SORT PAGES        COBOL41J
         CVS,D2   K3VAL-16          CONVERT TO DISPLAY                  COBOL41J
         SLS,D3   4                                                     COBOL41J
         OR,D3     =X'F'            PUT SIGN IN NUMBER                  COBOL41J
         AI,R1    1                                                     COBOL41J
         UNPK,2   STBAS,R1          STORE IN COL 41 OF SORT PARAMETER   COBOL41J
         AI,R1     2                                                    COBOL41J
         LB,D2     STBAS,R1         LOAD 3 RD BYTE                      COBOL41J
         OR,D2     =X'F0'           MAKE IT EBCDIC                      COBOL41J
         STB,D2    STBAS,R1                                             COBOL41J
         LI,R1    23
         LI,D2    C'S'              TURN ON SEQUENCE CHECK OPTION
         STB,D2   STBAS,R1
         AI,R1    1
         LI,D2    C'D'
         STB,D2   STBAS,R1
         WPOF     ,BA(STBAS)-7      WRITE SORT PLIST
*
         LI,V0    DACB              LOAD,STORE CLNG CNTL
         STW,V0   MAIOC+5
         LI,R4    BA(MAIOC)+22
         BAL,L1   ADV00             WRITE SORT CLUSTER
         BAL,L1   WRMCF
         LW,R6    CRSIO                                                 COBOL41J
         CI,R6    2                 INPUT/GIVING                        COBOL41J
         BANZ     ACC30             YES.  GENERATE GIVING CODE          COBOL41J
ACB81    RES      0                                                     COBOL41J
*
         LW,V1    MAIOC+7           CHECK GIVING FLAG
         CI,V1    X'20000'
         BAZ      ACB83             JUMP IF OUTPUT PROCEDURE            COBOL41J
         MTW,0    SORTFG            IS INPUT PROCEDURE EXIST ?          COBOL41J
         BLEZ     ACB82             JUMP IF NO                          COBOL41J
         LI,R4    BA(SRTOC)+2       GET BA(OPEN SRT FILE MCF)           COBOL41J
         BAL,L1   WRMCF             OUTPUT 'OPEN SRT FILE' MCF          COBOL41J
         LI,R4    X'240'            SET 'CLOSE WITH RELEASE'            COBOL41J
         STH,R4   SRTOC+1               OPTION                          COBOL41J
         LI,R4    BA(SRTOC)+2                                           COBOL41J
         BAL,L1   WRMCF             OUTPUT 'CLOSE SRT WITH RELEASE' MCF COBOL41J
ACB82    LI,R4    -10000            REINITIALIZE SORTFG TO              COBOL41J
         STW,R4   SORTFG               IND NOT NON-RES SORT             COBOL41J
         B        AA00              RETURN                              COBOL41J
ACB83    MTW,1    SORTFG            ADD 1 TO SORTFG                     COBOL41J
* OUTPUT PROCEDURE
         LI,L1    AA01+CSI-5        SET OPEN INPUT OUTSORT SWITCH
         STW,L1   JMCRD
         STW,V1   MAIOC+1           STORE OUTSORT DDB OFFSET
         LI,R6    CLOP              LOAD OPEN INPUT OPTION
         B        ACB50+1           OPEN,PERFORM,CLOSE OUTSORT
*
* RETURN                            TYPE = X'64'                        ACC
ACC00    RES      0                                                     ACC00
         LW,R1    PDBJ             CHECK IF CO-RES SORT                 COBOL41J
         CI,R1    3
         BAZ      %+2                NOT CO-RES SORT                    COBOL41J
         BAL,L1   ACC85             WRITE SPECIAL MCF                   COBOL41J
         LI,V1     CCASO+X'400'     LOAD OUTPUT/E-O-OUTPUT PROC. FLAG
         LI,L1    ABR00             SET LINK REGISTER
         B        ACA02
         TITLE    'PHASE 4.1 - REPORT'
ACC10    RES      0                                                     COBOL41J
         LI,D1    0                                                     COBOL41J
         STW,D1   IPPF              RESET INPUT PROCEDURE FLAG          COBOL41J
         STW,D1   CRSF              RESET CRSF                          COBOL41J
         CB,R6    IOF               CHECK OPTIONS                       COBOL41J
         BAZ      ACB45             USING AND GIVING                    COBOL41J
         BE       ACC12             INPUT AND OUTPUT PROCEDURE          COBOL41J
         AI,D1    1                                                     COBOL41J
         CI,R6    X'20'                                                 COBOL41J
         BANZ     ACC12             USING/OUTPUT                        COBOL41J
         AI,D1    1                 ELSE        INPUT AND GIVING        COBOL41J
ACC12    RES      0                                                     COBOL41J
         MTW,1    CRSF                                                  COBOL41J
         STW,D1   CRSIO             SAVE SORT OPTIONS.                  COBOL41J
         LI,V0    CLI+CRR5                                              COBOL41J
         BAL,L1   PIA02             LI,R5  X   X=0 I/O  =1 U/O   =2 I/G COBOL41J
         LH,D3    PDBS                                                  COBOL41J
         AND,D3   =X'FFFC'                                              COBOL41J
         CH,D3    PDBS              GLOBLE ON A WORD BOUNDARY           COBOL41J
         BE       ACC13             YES                                 COBOL41J
         AI,D3    4                 FORCE ON WORD BOUND                 COBOL41J
         STH,D3   PDBS              UPDATE GLOBLE                       COBOL41J
ACC13    RES      0                                                     COBOL41J
         AW,D3    K4BAS                                                 COBOL41J
         LI,V0    CLI+CRR6                                              COBOL41J
         BAL,L1   PID11             LI,R6  WA(SORT PLIST)               COBOL41J
         BAL,L1   PIX06             BAL,11 C:SRT'                       COBOL41J
         TEXT     ':SRT'                                                COBOL41J
         LW,V0    CRSIO             CHECK OPTIONS                       COBOL41J
         CI,V0    1                 USING                               COBOL41J
         BANZ     %+4               YES.  CONTINUE                      COBOL41J
         BAL,L1   PIL06             B   %+4                             COBOL41J
         B        4                                                     COBOL41J
         B        ACB50             RETURN TO INPUT PROCEDURE PROCESS.  COBOL41J
ACC20    RES      0                 USING                               COBOL41J
         MTW,1    IPPF              SET FLAG                            COBOL41J
         LH,R7    1,R2              LOAD DDB NO.                        COBOL41J
         BAL,L0   ADO00             CHECK USING FILE                    COBOL41J
         B        AA00              INVALID FILE                        COBOL41J
         STW,R7   JCBDI             SAVE WA(DDB)                        COBOL41J
         STW,D3   SAVE%2            SAVE DDB NO.                        COBOL41J
         LI,D1    1                 SET OPEN INPUT                      COBOL41J
         BAL,L1   ACC22             OPEN FILE                           COBOL41J
         BAL,L1   PIX06                                                 COBOL41J
         TEXT     ':OPN'            BAL,L1   C:OPN                      COBOL41J
         LW,D3    SDDBN                                                 COBOL41J
         LI,V0    CLI+CRR6                                              COBOL41J
         BAL,L1   PID11                                                 COBOL41J
         BAL,L1   PIX06             BAL,11    C:RLR                     COBOL41J
         TEXT     ':RLR'                                                COBOL41J
         BAL,L1   PIL06                                                 COBOL41J
         B        3                 B  %+3                              COBOL41J
         BAL,L1   PIL06                                                 COBOL41J
         B        4                 B  %+4                              COBOL41J
         BAL,L1   PIA06                                                 COBOL41J
         B        *11               B  *11                              COBOL41J
         BAL,L1   PIX06             BAL,11   C:WSR                      COBOL41J
         TEXT     ':WSR'                                                COBOL41J
         BAL,L1   PIL06                                                 COBOL41J
         B        X'FFFA'                                               COBOL41J
         LI,D1    512                                                   COBOL41J
         BAL,L1   ACC22             SET CLOSE FILE                      COBOL41J
         BAL,L1   PIX06                                                 COBOL41J
         TEXT     ':CLS'            BAL,L1   C:CLS                      COBOL41J
         BAL,L1   PIA06             GEN 'LI,6 0'                        COBOL41J
         LI,R6    0                                                     COBOL41J
         BAL,L1   PIX06             GEN                                 COBOL41J
         TEXT     ':WSR'              'BAL,11 C:WSR'                    COBOL41J
         BAL,L1   PIL06                                                 COBOL41J
         B       35                 B   %+35                            COBOL41J
         LW,D3    SAVE%2            LOAD DDB NO.                        COBOL41J
         B        ACB46             CONTINUE USING PROCESSING           COBOL41J
*                                                                       COBOL41J
ACC22    RES      0                                                     COBOL41J
         STW,L1   SAVE%1                                                COBOL41J
         LI,V0    CLI+CRR14                                             COBOL41J
         BAL,L1   PIA02             LI,R14   1 OR 2                     COBOL41J
ACC23    LW,D3    9,R7                                            29174 COBOL41J
         AND,D3   K0FF                                                  COBOL41J
         SW,D3    K032                                                  COBOL41J
         STW,D3   SDDBN                                                 COBOL41J
         LI,V0    CLI+CRR6                                              COBOL41J
         BAL,L1   PID11             LI,R6   I:                          COBOL41J
         B        *SAVE%1                                               COBOL41J
ACC25    STW,L1   SAVE%1            GEN 'LI,6 I:FILE' ONLY        29174 COBOL41J
         LW,R7    JCBDO             GET WA(DDB) OF (SORT) FILE    29174 COBOL41J
         B        ACC23                                           29174 COBOL41J
*                                                                       COBOL41J
ACC30    RES      0                                                     COBOL41J
         LH,R7    1,R2              LOAD DDB NO.                        COBOL41J
         BAL,L0   ADO10             CHECK GIVING FILE                   COBOL41J
         B        AA00              INVALID FILE                        COBOL41J
         STW,R7   JCBDO             SAVE WA(DDB) OUTSORT                COBOL41J
         STW,D3   SAVE%2            SAVE DDB NO.                        COBOL41J
         BAL,L1   PIL06                                                 COBOL41J
         B        14                GENERATE 'B %+14'                   COBOL41J
         LI,D1    2                 SET OPEN INPUT                      COBOL41J
         BAL,L1   ACC22             OPEN FILE                           COBOL41J
         BAL,L1   PIX06                                                 COBOL41J
         TEXT     ':OPN'            BAL,L1   C:OPN                      COBOL41J
         BAL,11   ACC25             GEN 'LI,6 I:FILE' ONLY        29174 COBOL41J
         BAL,L1   PIX06             BAL,11   C:RSR                      COBOL41J
         TEXT     ':RSR'                                                COBOL41J
         BAL,L1   PIL06                                                 COBOL41J
         B        2                 B   %+2                             COBOL41J
         BAL,L1   PIL06                                                 COBOL41J
         B        4                                                     COBOL41J
         LW,D3    SDDBN                                                 COBOL41J
         LI,V0    CLI+CRR6+2                                            COBOL41J
         BAL,L1   PID11                                                 COBOL41J
         BAL,L1   PIX06             BAL,11   C:WLR                      COBOL41J
         TEXT     ':WLR'                                                COBOL41J
         BAL,L1   PIL06                                                 COBOL41J
         B        X'FFFB'                                               COBOL41J
         LI,D1    512                                                   COBOL41J
         BAL,L1   ACC22             SET CLOSE                           COBOL41J
         BAL,L1   PIX06                                                 COBOL41J
         TEXT     ':CLS'                                                COBOL41J
         LW,D3    SAVE%2            LOAD DDB NO.                        COBOL41J
         B        ACB81             CONTINUE GIVING PROSSESING          COBOL41J
ACC85    RES      0                                                     COBOL41J
         STW,L1   SAVE%1                                                COBOL41J
         WMCF     ,BA(MCFIOC)                                           COBOL41J
         B        *SAVE%1                                               COBOL41J
*                                                                       COBOL41J
*                                                                       COBOL41J
MCFIOC   DATA     X'03C2FF00'                                           COBOL41J
         DATA     X'00030000'                                           COBOL41J
IPPF     DATA     0                                                     COBOL41J
CRSIO    DATA     0                                                     COBOL41J
CRSF     DATA     0                                                     COBOL41J
CRSJCBDO DATA     0                                                     COBOL41J
IOF      DATA     X'28000000'                                           COBOL41J
SAVE%1   DATA     0                                                     COBOL41J
SAVE%2   DATA     0                                                     COBOL41J
SDDBN    DATA     0                                                     COBOL41J
         DEF      ACD00             INITIATE
         DEF      ACE00             GENERATE
         DEF      ACF00             TERMINATE
*                                                                       73
* INITIATE                          TYPE = X'5D'                        ACD
ACD00    RES      0                                                     ACD00
         CI,R6    1                 CHECK STMT OPTION                    2
         BANZ     ACD10             ALL OPTION                           3
ACD01    RES      0
         MTW,4    JDOID             SET FOR REPORT NAME
         BAL,L0   ADO10             CHECK FILE
         B        ACD06             INVALID FILE
* VALID INITIATE FILE
         AI,R6    X'6C81'           =0(LAST OP)/<0(NOT LAST OP)
ACD02    RES      0                                                      6
         BAL,L0   ACE14             WRITE LI,R2 R:REPORT NAME
*                                   ****  BAL,L1 C:RRI
         TEXT     ':RRI'            INITIATE
         BDR,R6   ACD12             FILE COUNT = FILE COUNT-1            8
         CI,R6    0                 LAST OP/E-O-DDB
         BE       AA02              YES
* NOT LAST OP
ACD04    RES      0
         RCRF     R5                NEXT FILE
         LH,R6    0,R5              OPTYP,STMT OPTION
         LH,R7    1,R2              DDB NO.
         B        ACD01
* INVALID FILE
ACD06    RES      0
         CI,R6    CLOP              LAST OP
         BAZ      ACD04             NO.
         B        AA02              RETURN
* ALL OPTION                                                            11
ACD10    RES      0                                                     12
         LI,L0    ACD02+1           SET LINK REGISTER
         LB,R6    PDBZ+4            LOAD DB CNT                         14
         LI,D3    5                 LOAD RDB CNTL
ACD12    RES      0                                                     20
         LI,R3    HA(STBAS)         LOAD HA(STKTOP)
         LH,R7    *PDBZ+4,R6        LOAD BA(DB OFFSET)                  21
         SLS,R7   -2                SET WA(DB OFFSET)                   22
         AW,R7    PDBZ+3
         CB,D3    *R7               CHECK DB CNTL                       24
         BE       ACE14             =  RDB.                             25
         BDR,R6   ACD12             NOT= RDB                            26
         B        AA02              RETURN                              27
*
* GENERATE                          TYPE = X'5A'                        ACE
ACE00    RES      0                                                     ACE00
         CI,R6    X'F9300'          CHECK FOR FILE                      50
         BGE      ACE10             FILE, GENERATE SUMMARY              51
* NOT FILE - GENERATE DETAIL                                            52
         LH,V1    1,R5              LOAD,CHECK DATA TYPE                53
         CI,V1    X'30E0'                                               54
         BG       ACE04             TYPE = RECORD                       55
* S*****INVALID REPORT RECORD*******                                    56
ACE02    RES      0                                                     57
         LAB,R1   AA092,XCAS+5      WRITE DMF CLUSTER
*                                                                       59
ACE04    RES      0                                                     60
         BANZ     ACE02             TYPE NOT= REPORT RECORD             61
         LH,D2    4,R2              SAVE REPORT REF NO.
         CI,D2    X'80'             IS A DETAIL GROUP (GENERATE) ? 9/17 COBOL41J
         BGE      ACE02             NO, ABORT                   9/17/75 COBOL41J
         LI,V2    IBCS              LOAD REF CNTL                       63
         BAL,L1   ADI00             CHECK DETAIL                        64
         B        AA01              INVALID DATA                        65
* VALID GENERATE DETAIL                                                 66
         AND,D2   K3FF              MASK REPORT REF NO.
         SLS,D2   3                 REP.NO. = REP.NO.*8+50              67
         AI,D2    50                                                    68
         LH,R7    JTDB              LOAD RDB NO.                        68
         LAB,L1   ACE12,ADO30-1                                         69
* FILE - GENERATE SUMMARY                                               70
ACE10    RES      0                                                     71
         LI,D2    0                 CLEAR DETAIL LINE FLAG              72
         LI,L1    ADO10             SET LINK REGISTER                   73
ACE12    RES      0                                                     74
         MTW,4    JDOID             SET FOR REPORT NAME                 75
         BAL,L0   *L1               CHECK FILE                          76
         B        AA02              INVALID FILE                        77
* VALID GENERATE FILE                                                   78
         LI,L0    ACE16             SET LINK REGISTER                   79
*                                                                       80
ACE14    RES      0                                                     80
         LW,R4    R7                LOAD,SET BA(RDB)                    80
         SLS,R4   2                                                     81
         AI,R4    13                SET BA(REPORT NAME)
         LB,R1    0,R4              HLNG = (BLNG+3)/2
         AI,R1    3
         SLS,R1   -1
         BAL,L1   AA80+2            XNAM TO STACK
*                        R1 = CLNG(HA)                                  86
*                        R4 = HA(RECORD NAME)(=HA(STBAS))               87
         STB,R1   STBAS-1           STORE CLNG                          88
         AI,R4    -2                HA(CLOC) = HA(RECORD NAME)-2        89
         LI,V0    X'2D9'            LOAD BLNG ADJ.,CHAR.(='R')          90
         BAL,L1   AA84+2            AFFIX R:                            91
*                                                                       91
         LI,V1    CLI+CRR2          LOAD LI,R2                          92
         BAL,L1   AA20+2            WRITE LI,R2 R:REPORT NAME           93
         LW,L1    L0                LOAD LINK REGISTER                  94
         B        PIX06             WRITE BAL,L1 C:R--                  95
*                                                                       96
ACE16    RES      0                                                     97
         TEXT     ':RRG'            GENERATE                            98
*                        D2 = DETAIL OFFSET/0(SUMMARY)                  99
         CI,D2    0                 CHECK DETAIL OFFSET                  1
         BNE      ACE18             NOT= 0. GENERATE DETAIL              2
* GENERATE SUMMARY                                                       3
         BAL,L1   PIA06             WRITE
         DATA     0                                                      5
         B        AA02                                                   6
* GENERATE DETAIL                                                        7
ACE18    RES      0                                                      8
         STH,D2   STBAS-1           STORE DETAIL OFFSET
         LI,V1    -CLI-CRR2         CLEAR OP CODE (=LI,R2)
         AWM,V1   STBAS-2
         WMCF     ,BA(STBAS-2),AA02 WRITE DATA R:REPORTNAME+OFFSET
*                                                                       AA0
* TERMINATE                         TYPE = X'6B'                        ACF
ACF00    RES      0                                                     ACF00
         CI,R6    X'FF00'           CHECK STMT OPTION
         BAZ      ACF10             ALL OPTION
ACF01    RES      0
         MTW,4    JDOID             SET FOR REPORT NAME
         BAL,L0   ADO10             CHECK FILE
         B        ACF06             INVALID FILE
* VALID TERMINATE FILE
         AI,R6    X'6C81'           =0(LAST OP)/<0(NOT LAST OP)
ACF02    RES      0                                                     46
         BAL,L0   ACE14             WRITE LI,R2 R:REPORT NAME
*                                   ****  BAL,L1 C:RR1+
         TEXT     ':RRH'            TERMINATE
         BDR,R6   ACD12             FILE COUNT = FILE COUNT-1           48
         CI,R6    0                 LAST OP/E-O-DDB
         BE       AA02
* NOT LAST OP
ACF04    RES      0
         RCRF     R5
         LH,R6    0,R5              OPTYP,STMT OPTION
         LH,R7    1,R2              DDB NO.
         B        ACF01
* INVALID FILE
ACF06    RES      0
         CI,R6    CLOP              LAST OP
         BAZ      ACF04             NO
         B        AA02              RETURN
* ALL OPTION                                                            50
ACF10    RES      0                                                     51
         LI,L0    ACF02+1           SET LINK REGISTER
         B        ACD10+1                                               53
* BIN TO DEC CVS TABLE
*
K3VAL    RES      0
         DATA     8000,4000,2000,1000,800,400,200,100
         DATA     80,40,20,10,8,4,2,1
K0FF     EQU      JAKON+1                                               COBOL41J
K4BAS    EQU      JAKON+8                                               COBOL41J
K032     GEN,8,24 X'32',0                                               COBOL41J
*
KBASTK   DATA     BA(STBAS)
KCBFIL   GEN,8,24 37,BA(STBAS)+11   PARAMETER LIST FILL CONSTANT
*
K3FF     EQU      JAKON+6
JTDB     EQU      JADAT+3           DDB NO.
JDOID    EQU      JADAT+X'1E'       DDB I.D.
JCBKC    EQU      JADAT+X'20'       KEYC
JCBKL    EQU      JCBKC+1           KEYL
JCBDI    EQU      JCBKC+2           RECORD BASE NO.,WA(DDB) SORTIN
JCBDO    EQU      JCBKC+3           WA(DDB) OUTSORT
JBPXN    EQU      JADAT+X'24'       PERFORM XNAM INDEX
*        RES      2
JSTYP    EQU      JADAT             SECTION REF TYPE
         BOUND    8                                                     COBOL41J
SRTINSN  DATA     3                 LEAST NUMBER OF SORT WORK FILES     COBOL41J
         DATA     17                MAX NO WORK FILES                   COBOL41J
SAVWK    DATA     0                 SAVE NO OF SORT WORK FILES          COBOL41J
SORTFG   DATA     -10000            INITIAL SORT FLAG                   COBOL41J
         DATA     0                 FOR TEMP SPACE                      COBOL41J
*        SORTFG < 0  CO-RES SORT OR NOT SORT SATEMENT                   COBOL41J
*        SORTFG = 0  NON-RES SORT BEGIN                                 COBOL41J
*        SORTFG = 1  NON-RES SORT WITH INPUT                            COBOL41J
*        SORTFG = 2  NON-RES SORT INPUT & SORT PROCESSED                COBOL41J
SRTOC    RES      10                FOR 'OPEN SRT FILE' MCF             COBOL41J
         END
