* HELMSMAN AMENDMENT NOTICE
*          
* Notice number: 070   Date:  10 November, 1995
*          
* This amendment introduces a new facility which enables
* the result codes returned at the end of a running job
* to be amended prior to the job being marked as finished
* by the Helmsman termination code.
*
* In order for this amendment to function correctly, a
* new SCL procedure is required. The source for this
* procedure, which can be found in this amendment notice,
* must be placed in the Helmsman ICL_RSI_SOURCE library
* and then compiled into the Helmsman ICL_RSI_OMF
* library.
*
* The SCL procedure will be called at the end of every
* running job which has a termination code of either:
*
*         1    Job completed OK
*         2    Job finished with a positive result code
*         12   Job finished with a negative result code
*
* If the procedure alters the result code, then the job's
* termination code will be altered accordingly.
*
* THIS AMENDMENT MUST BE APPLIED WITH HELMSMAN 2.5
* AMENDMENT 026/2 OR LATER.  Please apply this amendment
* using the procedure described in chapter 23 of the
* Helmsman User Guide.
*
* Module to be amended is: ICL8_UCJ0_HARNESS  ( 2500 )
*
CREATEREFERENCE(UCJFILTERRESULTCODE)
POINT(UCJ093.PATCHES)
ALTER(70,X00,XF0,NAME=UCJP250_070/0_P00)
POINT(UCJ055.UCJ055_LT)
PATCH(JUMP=NO,DISP=0,TO=CODE
   !A
   %UCJFILTERRESULTCODE
END,NAME=UCJP250_070/0_P01)
POINT(UCJ055.ISSUEJOBMESS_C)
PATCH(X9E,X49D400AE,CODE * LINE 689
   LSD.L    XE           * L_TYPE
   LDRL.P   #A
   CPS
   JNE      #B
   PRCL     4
   LSS      12
   SLSS     0
   SLSD.L   X15          * JOB_MESS
   ST.T
   RALN     9
   CALL.IC  X6C          * CTM_LOG
   LCT.L    4
#B RETURN
   ALIGN
#A X18000002
   8
   C'JN'
END,NO,NAME=UCJP250_070/0_P02)
POINT(UCJ055.CANCELJOB_C)
PATCH(XAC,X628D06A0,CODE * LINE 2140
   LSS.L    5            * REASON
   UCP      1            * COMPLETED_OK
   JE       #A
   UCP      2            * +VE RESULT
   JE       #A
   UCP      12           * -VE RESULT
   JNE      #Z

*  CALL THE FILTER PROCEDURE

#A LSS.L    XD           * JOB_RESULT
   IMYD     1
   ST.L     X13          * USE CLOCK AS TEMP STORAGE

   PRCL     4
   LSD.C    XB6          * THIS_JOB_ID
   STLN.L   3
   SLSS     X4C
   IAD.L    3
   LUH.P    #W           * DESC TO LONG RESULT
   ST.T
   RALN     9
   CALL.IC  !A           * UCJ_FILTER_RESULT_CODE
   LCT.L    4

   LSS.L    XD           * JOB_RESULT
   IMYD     1
   ICP.L    X13          * NEW_RESULT
   JE       #B

   LSS      X34          * WDESC
   IAD.L    3            * JOB_RESULT
   LUH.P    #X           * ->
   LD.IC    XDA          * ICL8_UCJ_MTM_PARAMS
   ST.D     7            * (7)

   LSS      X4C          * DWDESC
   IAD.L    3            * NEW_RESULT
   LUH.P    #W           * ->
   LD.IC    XDA          * ICL8_UCJ_MTM_PARAMS
   ST.D     8            * (8)

*  LOG MESSAGE TO THE LOG FILE

   PRCL     4
   LB.IC    XCA
   LD.P     #X           * A_FILE.B_32.J_KEY.TIME
   INCA.B
   STD.T

   LD.P     #V           * A_FILE.B_32.ACJ_DATA.USER_NAME
   INCA.B
   STD.T

   LD.P     #U           * A_FILE.B_32.ACJ_DATA.JOB_NAME
   INCA.B
   STD.T

   LD.P     #T           * A_FILE.B_32.OWN.ID
   INCA.B
   STD.T

   LSS      80703
   ST.T

   LDRL.P   #Y
   STD.T

   RALN     16
   CALL.C   X1A8         * ISSUE_JOB_MESS

   LSD.L    X13          * NEW_RESULT
   ISH      32
   USH      -32
   MPSR     X11
   ST.L     XD           * JOB_RESULT

   JNP      #C
   LSS      2
   J        #E

#C JZ       #D
   LSS      12
   J        #E

#D LSS      1
#E ST.L     5

*  RESTORE CLOCK

#B RRTC     0
   ST.T
   USH      -28
   IAD      8
   AND      16
   USH      28
   IAD.T
   SHS      1
   ST.L     X13

#Z LSS.L    XD           * JOB_RESULT
   JNP      XE0
   J        XB2
   ALIGN
#T X28000001
   X0000430C
#U X18000018
   X000044C0
#V X18000020
   X000044A0
#W X30000001
#X X28000001
   X000045BC
#Y X18000002
   8
   C'JN'
END,NO,NAME=UCJP250_070/0_P03)
CHE(BC2528AD)

*
* SCL Procedure ICL_RSI_SOURCE.ICL8_UCJ0_FILTER_RCODE
*

PROC ICL8_UCJ0_FILTER_RCODE (UCJ_FILTER_RESULT_CODE) IS (
                             LITERAL JOB_ID,
                             REF INT RESULT_CODE )
PROCBEGIN

@ This procedure is called at the end of every running job  @
@ so that the jobs final result code (reported by Helmsman) @
@ can be amended. It is only called if the jobs termination @
@ code is one of:                                           @
@                     1 - Completed OK                      @
@                     2 - Finished with a positive result   @
@                    12 - Finished with a negative result   @
@                                                           @
@ If the procedure alters the result code, then the job's   @
@ termination code will be altered accordingly.             @

@                                                           @
@ The JOB_ID is 8 characters in the format: xxxxnnnn, where @
@ "xxxx" is the system_id and "nnnn" is the job number.     @

@ Example CODE:                                             @
@                                                           @
@         IF RESULT_CODE EQ -70118                          @
@         THEN                                              @
@             RESULT_CODE := 0                              @
@         FI                                                @

PROCEND
