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.
Figure 1. Syntax
(1)
Segment details

1 1SEGMENT=segname +  #
2.1 ? layout_ref.  field_ref=field_value2
2.1 ? + 3 qualifier .field_name=field_value
Notes:
  • 1 To use field_ref or field_name, you must have already loaded a view by preceding this function call with a call to VIEWIMS.
  • 2 Specification of a field_ref without qualification of a layout_ref results in the field_ref being associated with the first layout for the delsegm segment.
  • 3 To fully qualify a field_name, the layout name must be the first qualifier specified. If the layout name is not specified, FM/IMS searches all the layouts for the delsegm segment in relative order until the group qualifiers and field_name are found. If not found, an error message is displayed and processing terminates.
conkey
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.

delsegm
The name of the segment you want to delete.
field_name
The name of a key field in the segname segment, as specified in the template or view.
field_ref
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.
field_value
The value of the key field specified by field_ref or field_name.
FIRST
Deletes the first segment in the database that satisfies the WHERE clause.
layout_ref
The relative number of layout within segname segment. This can be obtained by printing the view/template using the VIEWIMS DESCRIBE clause.
NEXT
Deletes the next segment in the database after the current segment that satisfies the WHERE clause.
qualifier
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.
segname
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 ')
/+
⋮