You can use the following programming techniques when working with the CTMCOD macro:
To do this, save CTMBCOD fields CODPREVC, CODPREVL, and CODAMIC after reading the code to be updated, and then restore those values before the code is updated.
The following sample code illustrates this technique:
CTMCOD GETNEXT,CODE=MITCCPRE
MVC KEEPPREC,CODPREVC
MVC KEEPPREL,CODPREVL
MVC KEEPAMIC,CODAMIC
(read and process other codes)
MVC CODPREVC,KEEPPREC
MVC CODPREVL,KEEPPREL
MVC CODAMIC,KEEPAMIC
CTMCOD PUT
CODPREVC contains the address of the code that was read by CTMCOD GETNEXT. CODPREVL contains the length from this address until end of the MIC. CODAMIC contains the address of the MIC where the code resides. All these fields are used by CTMCOD PUT in order to locate the requested code and replace it with the value in CODOUTC.
Parent Topic |