Command statements
Some commands and keywords can be abbreviated. See Abbreviations.
Refer to Related Publications for an explanation of how to read the "railroad logic" diagrams used to notate the syntax of commands and keywords.
Commands fall into two categories: environment and action.
Environment primary commands are as follows:
PSB | Identifies the target database name or the PCB of the target database to be processed. |
SET | Overrides the system processing defaults. |
TITLE | Defines the title of a report. |
TYPE | Specifies whether the command statements are to be validated only or validated and immediately executed. |
SETEXTRACT | Overrides system defaults for the EXTRACT sub-command. |
These commands must be followed by at least one keyword. For example:
TYPE is the primary command; RUN is the keyword.
See Environment-primary-commands for a complete description of these primary commands and their use.
Action primary commands are as follows:
COUNT | Counts segments, extracts concatenated keys of segments, or both. |
INSERT | Inserts an occurrence of the specified segment into a database. |
Prints a single segment, all segments for a record, or all children for a parent in formatted or unformatted mode or prints fields in formatted mode. | |
SELECT | Applies segment selection criteria to select specific segments for processing. Sub-commands are then used to change, count, delete, insert, print, and/or extract the selected segments. |
Action commands must be followed by at least one SEGMENT object keyword. Optional keywords are entered, as needed, to attain the desired results. For example:
PRINT is the primary command; SEGMENT is the object keyword; MAX is an optional keyword.
Refer to Action Primary Commands for a complete description of these primary commands and their use. There are two object keywords, SEGMENT and CHILD, that are described in Object-keywords. Refer to Optional-keywords for a description of all the optional keywords.
All command statements are validated prior to execution. The validation process first checks each command statement for correct syntax, command and keyword consistency, completeness, and IMS validity.
A syntactically correct command is then cross-checked with the database for validity. For example: Are the field names valid in the SET or WHERE statements; does a request for a root segment in an HDAM database use partial keys or Boolean calls? The validity check does not guarantee that a specific data segment exists. If no errors are detected, the process proceeds based on the TYPE command keyword. The default is RUN.
This section provides information about the following topics: