Updating definitions in batch
To update object definitions in batch
- Update the objects in the import EXEC that MAMEXPRT created.
- 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.
- Run the EXEC to import the objects into 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')'
/* */
/* 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*