How to automate the detection and recovery of CA Jobtrac Job Management Automatic Message Recognition (AMR) deactivation.

Document ID : KB000051567
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

This Knowledge Document contains an automatic method to reactivate your AMR table.

Solution:

This solution will allow you to detect that the AMR function has been deactivated and then it will automatically activate it for you. Below is an imod that contains steps you will need to follow to automate the detection of a deactivated Automatic Message Recognition function and the activate it.

SAMPLE IMOD TO DETECT AMR INACTIVE STATUS AND ISSUE RESTART

#DESC SAMPLE IMOD TO DETECT WHEN AMR IS NOT WORKING                            
#SOURCE                                                                        
#CALLABLE                                                                      
/*                                                                                     */    
/*THIS IMOD WILL HELP DETECT WHEN IF AMR IS INACTIVE.                                  */    
/*FOR THIS IMOD TO WORK PROPERLY, YOU WILL NEED TO DO THE FOLLOWING:                   */    
/*                                                                                     */    
/*                                                                                     */    
/*                                                                                     */    
/*1) THIS IMOD MUST BE SCHEDULED IN JOBTRAC AS AN INTERVAL EVENT.                      */    
/*   SEE THE SCHEDULE CREATION GUIDE FOR MORE DETAILS ON SCHEDULING                    */    
/*   INTERVAL EVENTS.                                                                  */    
/*                                                                                     */ 
/* HERE IS AN SCL SAMPLE TO RUN EVERY 15 MINUTES:                                      */    
/*                                                                                     */    
/**EVENTNM TIME DATE DEPS  RELEASE1RELEASE2RELEASE3RELEASE4 PROCESSP                   */    
/**        *    *    *     *       *       *       *        *                          */    
/*JOBTWTO  ASAP *   E                                                  =MTWTFSS        */ 
/*JOBTWTO                 I=0015/2100                                  =MTWTFSS        */ 
/*                                                                                     */ 
/*                                                                                     */    
/*                                                                                     */    
/*2) THE AMR TABLE MUST CONTAIN THE FOLLOWING TWO ENTRIES:                             */ 
/*------------------------------------------------------------------                   */ 
/*    MSG TEXT : '//JOBTWTO'                                                           */ 
/*COMMAND/REPLY: R XX,NO                                                               */ 
/*ALTERED TEXT :                                                                       */ 
/*PROCESS PRD  :            CREATE EVENT:          TRIGGER EVENT:                      */ 
/*TOD RANGE    :            SYS:                   TRG ACT: ( RPLY )                   */ 
/*------------------------------------------------------------------                   */ 
/*    MSG TEXT : '//JOBTWTO'                                                           */ 
/*COMMAND/REPLY:                                                                       */ 
/*ALTERED TEXT :                                                                       */
/*PROCESS PRD  :            CREATE EVENT:          TRIGGER EVENT:                      */
/*TOD RANGE    :            SYS:                   TRG ACT: ( SUPP )                   */
/*------------------------------------------------------------------                   */
/*                                                                                     */ 
/*                                                                                     */    
/*                                                                                     */    
/*3) THE VINIT3 PROC MUST BE CUSTMIZED TO EXECUTE, TO RELOAD THE                       */
/*   AMR EXIT.                                                                         */
/*                                                                                     */ 
/*                                                                                     */    
/*                                                                                     */    
/*4) CONSIDERATIONS FOR IMODS, SEE SYS OPTS IN JOBTRAC ISPF:                           */
/*  REXX MAXIMUM TIME (HHMM)   => HHMM     ** SHOULD BE                                */
/*                                                                                     */ 
/*                                                                                     */    
/*                                                                                     */    
/*5) YOU WILL NEED TO RESPOND 'YES' TO THE WTOR IF AMR IS DOWN. THIS                   */
/*   WILL ENVOKE THE COMMNDS TO RESTART AMR.                                           */
/*                                                                                     */ 
/*                                                                                     */    
/*                                                                                     */    
/*6) SEE TRACINST(JB$INIT) MEMBER TO COPY AND COMPILE IMOD.                            */
/*                                                                                     */
/*NOTE: ALL MSGS SHOW UP IN THE GSS STC.                                               */
/*                                                                                     */
/* ISSUE WTOR. IF AMR IS ACTIVE, IT   WILL SUPRESS THIS MESSAGE AND REPLY              */
/* TO THE WTOR AUTOMATICALLY.                                                          */
/* IF THE FOLLOWING WTOR IS DISPLAYED ON THE CONSOLE:                                  */
REPLY = WTOR('JOBTWTO AMR INACTIVE. DO YOU WISH TO REINITIALIZE?',,'2')    
/* ISSUE THE FOLLOWING CONSOLE COMMAND: R XX,YES                                       */
/*   THIS WILL ENVOKE THE IMOD TO ISSUE THE FOLLOING COMMANDS:                         */
/*   1) ISSUE 'XOFF' CONSOLE COMMAND.                                                  */
/*   2) ISSUE 'K M,UXEIT=Y'CONSOLE COMMAND.                                            */
/*      (PAUSE 5 SECONDS)                                                              */    
/*   3) ISSUE START COMMAND ON VINIT3 PROC.                                            */    
/*      (PAUSE 20 SECONDS)                                                             */    
/* AND THEN ISSUE THE WTOR, AND IF AMR WAS SUCCESSFULLY ACTIVATED THEN                 */    
/* THIS MESSAGE WILL BE SUPRESSED.                                                     */    
IF SUBSTR(REPLY,1,1) = "Y" THEN DO                                             
   X=OSCMD('XOFF')                                                             
   X=OSCMD('K M,UEXIT=Y')                                                      
   PAUSE(5)                                                                    
   X=OSCMD("S VINIT3,PARM='ONLY=GJTRVMXT'")                                    
   PAUSE(20)                                                                   
   X=WTO('JOBTWTO   REACTIVATION OF JOBTRAC AMR WAS UNSUCCESSFUL.',,'2')       
END

Information on adding and compiling an imod can be found in the CA Common Services Administration Guide, Chapter 9 on "CA Global Subsystem".