* HELMSMAN AMENDMENT NOTICE
*          
* Notice number:  014     Date:  21 September, 1994
*          
* The Helmsman job details file (UCJ_JOB_DETAILS_FILE) has an
* internal limit of 16000 2K blocks, which therefore limits
* the number of jobs that can be defined in Helmsman.  This
* limit varies between 5000 and 15000 jobs depending on
* whether jobs have variable parameter keywords and/or
* dependencies
* This amendment increases the block allocation limit to 64000
* 2K blocks, which in turn increases the job limit to between
* 20000 and 60000 jobs.
*
* THIS AMENDMENT MUST BE APPLIED WITH HELMSMAN 2.5 AMENDMENT
* 013/1.
*
* Please apply this amendment using the procedure
* described in chapter 23 of the Helmsman User Guide.
* After applying this amendment the job details file must be
* dumped and recreated using UCJ_FILE_MAINT prior to
* restarting the Helmsman JSVM:
*
*             UCJ_FILE_MAINT(DUMP,JOB)
*             UCJ_FILE_MAINT(CREA,JOB,UCJJOBDETSDMP)
*
* Module to be amended is: ICL8_UCJ0_UTILS  ( 2500 )
*
POINT(UCJ093.PATCHES)
ALTER(14,X00,XF0,NAME=UCJP250_014/0_P00)
POINT(UCJ094.UCJFHALBL_C)
PATCH(X272,X7BD40090,CODE  * LINE 2027
     LSS     0
     ST.L    X15           * BLOCK_OFFSET
     LB.IC   X90           * OVERWRITTEN
END,YES,NAME=UCJP250_014/0_P01)
PATCH(X122,X7BD40090,CODE  * LINE 2118
     LSS     0
     ST.L    X15           * BLOCK_OFFSET
     LB.IC   X90           * OVERWRITTEN
END,YES,NAME=UCJP250_014/0_P02)
PATCH(X51C,XC198C001,CODE  * LINE 1962
     UAD.T                 * OVERWRITTEN
     UAD     1             * OVERWRITTEN
     ST.T
     LSS.L   X15           * BLOCK_OFFSET
     IMY     16000         * 16000 BITS PER ALLOCATION BLOCK
     UAD.T
END,YES,NAME=UCJP250_014/0_P03)
PATCH(X1DE,X659400E2,CODE  * LINE 2162
     LD.C    XE0           * DESC TO J128
     LDTB.P  #Z
     INCA    24
     LSS.D                 * J128.RT.ID
     ST.L    X15           * BLOCK_OFFSET
     LSD.C   XE2           * JD128.USED
     ST.L    X11           * IND_REM
     JLK     X4BE          * GET_BN
     JNZ     X1F2          * BLOCKS ALLOCATED OK - LINE 2172
     LD.C    XE0           * DESC TO J128
     LDTB.P  #Z
     INCA    8
     LSS.D                 * J128.RT.NEXT
     ST.L    X18           * B_NUMBER
     JNZ     X1AA          * LINE 2154
     LSS     80101         * NOW FREE BLOCKS
     ST.L    XC            * RES
     J       X242          * LINE 2193
     ALIGN
#Z   X2B000001
END,NO,NAME=UCJP250_014/0_P04)
POINT(UCJ094.UCJFHFRBL_C)
PATCH(X1D2,X1D8000BA,CODE  * LINE 1822
@
@    BLOCK_CHANGED := 0
@    LOOP_END := NUMBER - 1
@    BASE_128 := B_NUMBER
@
     LSS.L   X14           * B_NUMBER
     ST.L    X16           * BASE_128
     LSS     0
     ST.L    X15           * BLOCK_CHANGED
     LSS.L   X6            * NUMBER
     USB     1
     ST.L    X9            * LOOP_END
     LB      0
@
@    FOR COUNT TO LOOP_END
@
#L   CPB.L   X9            * LOOP_END
     STB.L   X19           * COUNT
     JG      #A            * END OF FOR
@
@    INT C_BLOCK := INDS(BLOCKS MODD COUNT) - 1
@
     LD.L    XF            * BLOCKS
     MODD.L  X19           * COUNT
     LSS.D
     USB     1             * -1
     ST.L    X1A           * C_BLOCK
     JN      #H            * do next one
     ICP     13
     JGE     #I
@
@    Invalid block number to return
@
     PRCL    4
     LSS     80126         * MTM_INVALID_RETURN_BLOCK
     ST.L    XD            * RES
     ST.T
     RALN    6
     CALL.IC X7A           * UCJ_FH_ERROR
     LCT.L   4
     J       X21C          * LINE 1838
@
@    WORD BLOCK_ID := C_BLOCK / 16000
@
#I   IDV     16000
     ST.L    X1B           * BLOCK_ID
@
@    IF JDF.J128.JD128.RT.ID NE BLOCK_ID THEN
@       write current allocation block
@       find correct allocation block
@    FI
@
#F   LD.C    XE0           * DESC TO JDF.J128.JD128
     LDTB.P  #Z
     INCA    24
     LSS.D                 * JDF.J128.JD128.RT.ID
     UCP.L   X1B           * BLOCK_ID
     JE      #C            * we have the right allocation block
     LSS.L   X15           * BLOCK_CHANGED
     JZ      #G            * block wasn't changed
     JLK     #D            * Write allocation block
     JNZ     X21C          * failed !! LINE 1838
@
@    We now need to find allocation block that has an
@    ID that equals BLOCK_ID.
@
#G   LSS.L   X16           * BASE_128
     ST.L    X14           * B_NUMBER
#M   JLK     #J            * READ_ALLOCATION_BLOCK
     JNZ     X21C          * failed !! LINE 1838
     LD.C    XE0           * DESC TO JDF.J128.JD128
     LDTB.P  #Z
     INCA    24
     LSS.D                 * JDF.J128.JD128.RT.ID
     UCP.L   X1B           * BLOCK_ID
     JE      #C
     LD.C    XE0
     LDTB.P  #Z
     INCA    8
     LSS.D                 * JDF.J128.JD128.RT.NEXT
     ST.L    X14           * B_NUMBER
     JNZ     #M
@
@    No more allocation blocks
@
     LSS     80106
     ST.L    XD            * RES
     J       X21C          * LINE 1838
@
@    We have the right allocation block
@    so lets mark the block as free
@
@    MASK := ((WORD:X'80') SCALE
@             (REMDIV(8,(C_BLOCK-OFFSET),BYTE_NUM) * (-1))) NEQ -1
@
#C   LSS     X80
     SLSS.L  X1B           * BLOCK_ID
     IMY     16000         * BLOCK OFFSET
     SLSS.L  X1A           * C_BLOCK
     ISB.T                 * SUBTRACT OFFSET
     IMDV    8
     ST.L    X1B           * BYTE_NUM
     LSS.T
     IMY     -1
     ST.L    XA
     LSS.T
     USH.L   XA
     NEQ     -1
     ST.L    X1C           * MASK
@
@    IND_REM(BYTE_NUM) := IND_REM(BYTE_NUM) & MASK
@
     LB.L    X1B           * BYTE_NUM
     LSS.MIL X11           * IND_REM(BYTE_NUM)
     AND.L   X1C           * MASK
     ST.MD
     LSS     1
     ST.L    X15           * BLOCK_CHANGED
@
@    REPEAT
@
#H   LB.L    X19           * COUNT
     ADB     1
     J       #L
@
@    All blocks marked as free so write current allocation
@    block to the file.
@
#A   LSS.L   X15           * BLOCK_CHANGED
     JZ      X21C          * LINE 1838
     JLK     #D            * WRITE_BLOCK
     J       X21C          * LINE 1838
@**********************************
@
@    SIMPROC WRITE_ALLOCATION_BLOCK
@
#D   RRTC    0
     ST.T
     USH     -28
     IAD     8
     AND     X10
     USH     28
     IAD.T
     SHS     1             * CLOCK_TIME() ->
     ST.IC   XE4           * JDF.J128.JD128.RT.TIME
     LSD.C   XE0           * JDF.J128.JD128 ->
     LB.IC   X90           * FH.RECORD_BUFFER
     LD.P    #Y
     INCA.B
     MV      0,0
     PRCL    4
     LSS     801           * BL_OVERWRITE_BLOCK
     SLSS    X50
     IAD.L   3
     LUH.P   #X            * B_NUMBER
     SLSS    6             * JOB_DETS
     ST.T
     RALN    9
     CALL.C  X10C          * DO_BLOCK_ACCESS
     ST.L    XD
     J.T
@
@    End of SIMPROC WRITE_ALLOCATION_BLOCK
@
@*****************************************
@
@    SIMPROC READ_ALLOCATION_BLOCK
@
#J   PRCL    4
     LSS     142           * BL_READ_BLOCK
     SLSS    X50
     IAD.L   3
     LUH.P   #X            * B_NUMBER
     SLSS    6             * JOB_DETS
     ST.T
     RALN    9
     CALL.C  X10C          * DO_BLOCK_ACCESS
     ST.L    XD
     JNZ     #K            * failed !!
     LSS     0
     ST.L    X15           * BLOCK_CHANGED
@
@    Block read ok, move to allocation buffer
@
     LB.IC   X90
     LD.P    #Y
     INCA.B
     CYD                   * FH.RECORD_BUFFER ->
     LD.C    XE0           * JDF.J128.JD128
     MV      0,0
     LSD.C   XE2           * JDF.J128.JD128.USED ->
     ST.L    X11           * IND_REM
     LSS.L   XD            * RES
#K   J.T
@
@    End of SIMPROC READ_ALLOCATION_BLOCK
@
@****************************************
     ALIGN
#X   X28000001
#Y   X18000800
     X000001D4
#Z   X2B000001
END,NO,NAME=UCJP250_014/0_P05)
CHE(15FB362E)
