INSERT primary command (Edit only)

The INSERT primary command inserts an occurrence of a segment type into the database.

Syntax


1 Insert ?segment-name
segment-name
The segment type you want to insert. If you do not specify this parameter, FM/IMS displays the Insert : Segment Selection panel. You can select a segment type from the list of segment types displayed on this panel.

When the INSERT primary command is issued and an insert of the specified segment type is permitted, FM/IMS displays either the Insert Root segment panel (if the specified segment is a root segment) or the Insert Segment panel (if the specified segment is not a root segment).

On the Insert Segment panel, the Key value fields in the Parent Keys area are displayed with either the key of the parent of the current segment (if the parent is in the path of the current segment) or low values (if the parent is not in the path of the current segment).

On the Insert Segment panel and the Insert Root Segment panel, the fields in the Data area are initialized to spaces when you are not using a view. When you are using a view, FM/IMS uses a segment layout when initializing the fields of the Data area. Numeric fields in the layout are set to zero, and nonnumeric fields are set to spaces.

Update the key and data fields with the values required for the segment you want to insert. FM/IMS:
  • Calls IMS to insert the specified segment occurrence
  • Returns to the IMS Data panel, redisplaying the page that was previously displayed

To return to the IMS Data panel without inserting a segment occurrence, press the Cancel key (F12).

You cannot insert a segment when:
  • The PCB being used to edit the database does not have the necessary processing option to insert the segment
  • The PCB being used to edit the database uses a secondary index and the segment is either the target of the secondary index or a parent of the target segment.
  • The segment is a concatenated segment that does not have data sensitivity for both the logical child and the destination parent.
  • The insert may result in a duplicate segment in a unique secondary index and a duplicate segment will cause a U0828 abend.

If any of the above conditions hold true for the current segment type, the INSERT command issues a diagnostic and does not display the Insert Root Segment panel or the Insert Segment panel.

Availability