CHILD primary command

The CHILD primary command allows you to change your position in the database from the current segment to any dependent segment of the current segment.

Syntax


1 CHIld ?segment-name
1 number
1 First
1 Last
segment-name
The name of the segment type to which you want to scroll. The segment type must be one of the segment types defined in the DBD to be a hierarchical dependent of the current segment.
Note:
  1. If FM/IMS doesn't find an exact match for segment-name within the DBD, it searches the list of segments in the DBD to determine if any of the segment names contain the value entered. The first segment name that contains a match is used with the CHILD command. For example:
                    ACCOUNTS
                       │
         ┌─────────────┴───────────────────┐
         │                                 │
      BRANCH                            CUSTOMER
                                           │
                                        CUSTADDR

    Entering 'CHILD CUST' would position on the next occurrence of the CUSTOMER segment in the database but would not find the CUSTADDR segment. However, you could enter 'CHILD ADDR' and this would retrieve the next occurrence of the CUSTADDR segment in the database.

  2. If the specified segment occurrence is not found, the current database position is unchanged and the following message is displayed: Invalid segment name

If segment name is not specified or is specified as *, scrolling is restricted to the first hierarchical child segment type under the current segment.

number
Must be a positive integer. Scrolls to the specified occurrence of the child segment type. Can be used in conjunction with the segment-name parameter to limit the scrolling to the specified occurrence of a given segment type. An error message is displayed if there are less than number occurrences of the specified dependent segment.
First
Requests scrolling to the first occurrence of the specified dependent segment type.
Last
Requests scrolling to the last occurrence of the specified dependent segment type.

When using a view, the CHILD command only operates on those segments that the view has made available. If the specified segment is found, then the current layout is changed to match the new current segment.

If the specified segment is not found, a message is issued and the database position is unchanged.

Availability