Updating definitions in batch


You can update the definition base either by using the user interface or in batch. If you have many objects to update, we recommend that you use batch.

You can use the TOM API to issue administrative and operations commands from an EXEC. When the registry export utility (MAMEXPRT) creates an import EXEC, it uses the ADD API function to add each object in the member to the target object definition base. 

Updating object definitions in batch isn't limited only to changing the values of existing attributes. You can also add definition attributes for abilities that are not available in other availability managers. For more information, see Object-REXX-stem-variables-for-ADD-CHANGE-and-GET. You can also change an object in to a layer object by adding an assignment statement for the LINE.PATTERN variable. When using this variable, maintain consistent naming conventions. For a list of naming conventions, see Naming-conventions-for-objects-and-items.

Best practice
We recommend that you use layering as much as possible. Using layering, you can quickly and easily define and manage objects. For more information, see Layering.

To update object definitions in batch

  1. Update the objects in the import EXEC that MAMEXPRT created.
  2. Change the origin of the start and stop events to be the name of the started task that you are managing.
    • The object reference variable &@STCNAME contains the name of the started task.
    • The variable names that contain the origin of events are oobj.objectType.startevt.#.orginstc and oobj.objectType.stopevt.#.orginstc.
    • Replace the value associated with the oobj.objectType.startevt.#.orginstc and oobj.objectType.stopevt.#.orginstc variables with &@STCNAME.
    • For a list of variables and how to use them, see Object-REXX-stem-variables-for-ADD-CHANGE-and-GET and ADD-Examples.
  3. Run the EXEC to import the objects into the definition base.

Important

You must insert the appropriate assignment instruction before you issue the TOMEXEC FUNC(ADD) command. Each TOMEXEC FUNC(ADD) command adds one object to the definition base.

The following figure displays an example of using the ADD API function to add an object to a definition base:

/* REXX--------------------------------------------------------*/       
 /*                                                             */       
 /* A sample EXEC that will add a new object to the definition  */       
 /* base named in the TOMEXEC FUNC(ADD) statement below.        */    
 /*                                                             */       
 /* The new object will have one entry in the valid system list,*/       
 /* one start event, one stop event, one start command and one  */       
 /* stop command defined.                                       */       
 /*                                                             */       
 /*-------------------------------------------------------------*/       
 PARSE UPPER ARG EXECNAME FILLER                                         

 DROP LINE.                                                              

 LINE.PRODUCT = 'STM'                                                    
 LINE.STM.NAME = 'MAMKZ021'                                              
 LINE.HOSTS.0 = '1'                                                      
 LINE.HOSTS.1.SYSNAME = 'SJSC'                                           
 LINE.START.0 = '1'                                                      
 LINE.START.1.CMD = 'S AAO,JOBNAME=MAMKZ021'                             
 LINE.START.1.MAX = '3'                                                  
 LINE.START.1.TIMEOUT = '60'                                             
 LINE.START.1.TYPE = 'MVS'                                               
 LINE.STOP.0 = '1'                                                       
 LINE.STOP.1.CMD = 'P MAMKZ021'                                          
 LINE.STOP.1.TIMEOUT = '60'                                              
 LINE.STOP.1.TYPE = 'MVS'                                                
 LINE.STM.STARTEVT.0 = '1'                                               
 LINE.STM.STARTEVT.1.ID = 'IEF403I'                                      
 LINE.STM.STARTEVT.1.ORGINSTC = '&@STCNAME'                              
 LINE.STM.STARTEVT.1.TYPE = 'MSG'                                        
 LINE.STM.STOPEVT.0 = '1'                                                
 LINE.STM.STOPEVT.1.ID = 'IEF404I'                                       
 LINE.STM.STOPEVT.1.ORGINSTC = '&@STCNAME'                               
 LINE.STM.STOPEVT.1.TYPE = 'MSG'                                         

 'TOMEXEC FUNC(ADD) OBJECT('MAMKZ021') STEM(LINE) DEFBASE(NEWDB)'        

 'IMFEXEC MSG 'Return code for ADD is 'TOMRC'''                     

 /*-------------------------------------------------------------*/  
 /*                                                             */  
 /* This section will report on any exception messages issued   */  
 /* by the ADD function that was just issued.                   */  
 /*                                                             */  
 /*-------------------------------------------------------------*/  
 IF TOMRC /= 0 THEN                                                 
   DO I=1 TO LINE.EXCEPT.0                                          
    'IMFEXEC MSG ''LINE.EXCEPT.I'''                                 
   END                                                              

 'IMFEXEC EXIT CODE('TOMRC')'

In this example:

  • A simple EXEC that adds one object to the object definition base called NEWDB.
  • Each assignment instruction after the DROP statement sets up an attribute in the object definition.
  • The ORGINSTC variables are set to the value in the &@STCNAME reference variable.
  • The TOMEXEC FUNC(ADD) command adds the object to the definition base.
  • The TOMRC variable contains the return code from the TOMEXEC FUNC(ADD) command.
  • If TOMRC has a non-zero return code, the exception variables that explain the warning or error are populated.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*