REPL call

Use the Replace (REPL) call to change the values of one or more fields in a segment.

Format

Read syntax diagramSkip visual syntax diagramREPLdb pcbaibi/o areassa
  Call Name DB/DC DBCTL DCCTL DB Batch TM Batch
For Full-Function: REPL X X   X  
For DEDB: REPL X X      
For MSDB: REPL X        

Parameters

db pcb
Specifies the DB PCB for the call. This parameter is an input and output parameter.
aib
Specifies the application interface block (AIB) for the call. This parameter is an input and output parameter. The following fields must be initialized in the AIB:
AIBID
Eye catcher. This 8-byte field must contain DFSAIBbb.
AIBLEN
AIB lengths. This field must contain the actual length of the AIB that the application program obtained.
AIBRSNM1
Resource name. This 8-byte, left-justified field must contain the name of a DB PCB.
AIBOALEN
I/O area length. This field must contain the length of the I/O area specified in the call list.
i/o area
Specifies the I/O area in your program that communicates with IMS. This parameter is an input parameter.
ssa
Specifies any segment search arguments (SSAs) to be used in the call. This parameter is an input parameter and is optional for the REPL call. Use only unqualified SSAs. The SSAs that you specify point to data areas in your program in which you have defined the SSAs for the call. You can use up to 15 SSAs in this parameter.

Usage

Before using a REPL call, be aware of the following conditions:

  • Segments that can be replaced must be defined as replace-sensitive by setting PROCOPT=A or PROCOPT=R on the SENSEG statement in the PCB. To learn more about PROCOPT, see SENSEG statement.

  • A REPL call must be preceded by one of the three Get Hold calls: GHN, GHNP, or GHU.

  • If your program tries to replace a segment that is not replace-sensitive and command code N is not specified, the segment data in the I/O area must match the segment data that gets returned by the Get Hold call. Any variance results in an AM status code, and no data gets replaced by the REPL call. To learn more, see AM.

  • After you retrieve a segment, do not change the field lengths in the I/O area before you issue the REPL call.

  • Use only unqualified SSAs on a REPL call. Using a qualified SSA is invalid and results in an AJ status code. To learn more see AJ.

To change field values in a segment, issue a Get Hold call to retrieve the segment and place it in the I/O area. Make your desired changes. Then issue a REPL call to replace the segment in the database with the modified segment from the I/O area.

You can use command codes with the REPL call.

  • Specify an unqualified SSA with an N command code if you do not change one or more segments that are returned on a Get Hold call, or if you do not want modifications in the I/O area to be reflected in the database. The N command code is available for use whether or not a D command code is used to return multiple segments on the preceding Get Hold call. To learn more, see N command code.

  • Use the Q command code to preserve a segment for use with your program. Normally, if no fields in a segment are changed by the REPL call, the lock is released when the application moves to another database record. The Q command prevents another program from updating the segment until your program reaches a commit point. To learn more, see Q command code.