TSO-ISPF JCL COBOL VSAM DB2 CICS IMS-DB Tools Articles Forum Quiz Interview Q&A

IMS REPL Call


Replacing a segment(REPL call):

The REPL call is used to update the segment occurrence of the database. This has to be preceded by a successful Get-Hold call. Once the segment is in the I/O area, the program can make any desired changes other than modifying the key field. Suppose, if a SHIPTO segment is to be modified.

The following is the DL/I call sequence required to this task.

Step1 :	GHUCUSTOMER(CUSTNUM='DV0002')
        SHIPTO(SHPTOSEQ='02')
Step2 :	REPL

After retrieving the desired SHIPTO segment with the Get-Hold call and making the necessary changes to the segment image in the I/O area, the program then issues a call using the REPL function code.

When a program uses a Get-Hold path call to bring more than one segment into the I/O area, the Get-Hold path call can be followed by a replace call that references one or more SSAs. When multiple segments are retrieved using a Get-Hold path call and a Replace call is issued with no SSAs, all the retrieved segments are replaced. The Replace call can reference SSAs that include the N command code to indicate which segments are not to be replaced.


Status Code Check:

When REPL call is issued to delete segment occurrences of a database, the status codes for the following codes needs to be checked. " "(Blank), "DJ", "DA".

Blank indicates that the replace call is successful. Return Status "DJ" indicates that the program has issued a replace call without a preceding Get-Hold call. The "DA" status code is returned, if the key field of the segment image in the I/O area is changed before the program issues the replace call.



If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on IBMMainframer Community!

Are you looking for Job Change? Job Portal