Batch Edit (IEB)

Purpose
Runs a REXX procedure that can contain both standard REXX statements and the following FM/IMS batch functions.
DELIMS
Delete an IMS segment
GETIMS
Retrieve an IMS segment
ISRTIMS
Insert an IMS segment
PRINT
Print an IMS segment
REPLIMS
Update an IMS segment
SAVEIMS
Commits the data to the IMS database and frees IMS resource. After SAVEIMS is issued, the position in the database is lost
SETRC
Sets the job step return code
VIEWIMS
Create a view for later use, or load an existing view (that you can then use with the GETIMS function to retrieve a segment).
VIEWPOSN
Positions on an IMS segment so that the next GETIMS (with USING_VIEW) retrieves segments starting at this point.
Usage notes
The REXX functions are available only in REXX procedures that you use with IEB.
Some of these functions pass values to, or read from, the following REXX variables:
INREC, OUTREC
The GETIMS function retrieves a segment, and passes the contents of the segment to both INREC and OUTREC. Use INREC as a reference variable only, and do not update it. You can update OUTREC, and use it as the contents of a new segment that you insert with the ISRTIMS function, or you can use it with the REPLIMS function to replace the contents of an existing segment.
FMSTATUS
Contains the DL/I status code from the previous DELIMS, GETIMS, ISRTIMS or REPLIMS function call. For a description of DL/I status code values, see IMS Messages and Codes.
FMCONKEY, FMSEGNM
Contains the concatenated key (FMCONKEY) or name (FMSEGNM) of the segment deleted, retrieved, inserted or replaced by the previous DELIMS, GETIMS, ISRTIMS or REPLIMS function call.
FMNDBDNM
Contains the DBD name. (However, this variable is null until you call a DELIMS, GETIMS, ISRTIMS or REPLIMS function.)

When using the Rexx function EXECIO, ensure that you code the command "ADDRESS MVS" before the EXECIO, otherwise you get an RC-3 executing the REXX.

These REXX variable names must be specified in all uppercase.

For all IEB functions:
The string of keywords and keyword values for each IEB function statement MUST be enclosed in single quotation marks. For statements requiring more than one line, each line must be enclosed in single quotation marks with the end quotation mark followed by a comma to indicate the continuation to the next line.
For IEB functions DELIMS, GETIMS, ISRTIMS and REPLIMS :
Where a field_value variable is specified for a #field_name or #field_ref keyword, the field_value variable may be enclosed in single or double quotation marks or may be specified without quotation marks.
For IEB function VIEWIMS:
Field selection_criteria are specified as REXX expressions. The selection_criteria expression should NOT be enclosed within single or double quotation marks.

The Batch Edit JCL generated by FM/IMS has the following flows:

Figure 1. Flows for Batch Edit (IEB) step
This diagram shows the inputs to and outputs from the Batch Edit (IEB) function. The inputs are FMN1JIN, FMNIMSIN, REXX procedure, and FMNEXEC. The output is SYSPRINT. IMS database data sets provide inputs and receive outputs.
FMN1JIN
Points to the FM/IMS skeleton library. This DD statement is only used when you are editing HALDB databases.
FMNIMSIN
Contains the control statements for the batch edit. These control statements are discussed below.
IMS database data sets
In DLI mode, FM/IMS includes DDs for each of the IMS database data sets associated with the IMS database being maintained. If the database has logical relationships, the data sets for the logically related databases need to be included.
SYSPRINT
This contains the FM/IMS messages that were issued by FM/IMS while running the IEB REXX procedure.
REXX Procedure
A REXX exec which is to be run to maintain the IMS database in batch. This exec consists of standard REXX statements combined with FM/IMS IEB calls to allow a user to read and update IMS segments.

In FMNIMSIN, if PROC=* is specified in the REXX procedure, the REXX procedure is specified instream after the PROC=* parameter.

In FMNIMSIN, if PROC=<member> is specified, REXX procedure <member> found in the FMNEXEC library is run.

FMNEXEC
This contains the member that is to be run if PROC=<member> is specified in the FMNIMSIN parameters.