DELIMS CALL (Delete an IMS segment)
This IEB call deletes the current segment.
- Purpose
- To delete an IMS segment
- Usage notes
- The DELIMS inbuilt FM/IMS REXX function can
be used to:
- delete the current segment.
- delete a particular segment by specifying a where clause.
- The concatenated key of the segment you want to delete.
If you specify the concatenated key of a segment that you have already deleted, then DELIMS produces a nonzero return code, and does not delete any segment.
- The name of the segment you want to delete.
- The name of a key field in the segname segment, as specified in the template or view.
- The reference number of a key field in the segname segment, as specified in the template or view. This can be obtained by printing the view/template using the VIEWIMS DESCRIBE clause or browsing the view/template online.
- The value of the key field specified by field_ref or field_name.
- Deletes the first segment in the database that satisfies the WHERE clause.
- The relative number of layout within segname segment. This can be obtained by printing the view/template using the VIEWIMS DESCRIBE clause.
- Deletes the next segment in the database after the current segment that satisfies the WHERE clause.
- One or more qualifiers that identify the field name (field_name).
The first qualifier is the segment layout name. Subsequent qualifiers (if any)
are the group fields used to identify the specified field name.
Omitting the layout name or group fields causes FM/IMS to search
the segment layouts for the specified qualifiers and field name.
Note: The layout names and group fields can be obtained by printing the view/template using the VIEWIMS DESCRIBE clause or browsing the view/template online.
- The name of a segment in the hierarchical path of the segment that you want to delete.
If FM/IMS encounters an unavailable HALDB partition or DEDB area, the DELIMS function receives a return code of 8 and the ISPF variable FMSTATUS indicates an IMS status code of:
- FH
- for an unavailable DEDB area.
- BA
- an unavailable HALDB partition.
Returns zero if successful, otherwise nonzero. If DELIMS is unsuccessful, then you can check the DL/I status code in the FMSTATUS REXX variable to determine the cause of failure.
To delete the current segment, omit the WHERE clause. Otherwise, use the WHERE clause to identify the segment you want to delete.
IEB example using DELIMS
⋮
$$FILEM IEB
⋮
$$FILEM PROC=*
filerc = VIEWIMS('TPLDSN=FMN.IMS.IVP.TEMPLATE')
/* Delete Segment at the current position */
filerc = GETIMS('SEGMENT=NSTREET NEXT')
filerc = DELIMS('SEGMENT=NSTREET')
/* Delete Segment using a where Clause */
filerc = DELIMS('SEGMENT=NSTREET ',
' WHERE SEGMENT=SUBURB #SUBURB-NAME=CITY BEACH',
'SEGMENT=NSTREET #2=FLOREAT BEACH ')
/+
⋮