POS command
The Position (POS
) command retrieves the location
of either a dependent or the segment.
Format
Options
- USING PCB(n)
- Specifies the DB PCB you want to use for the command. Its argument can be any expression that converts to the integer data type; you can specify either a number or a reference to a halfword in your program containing a number.
- INTO(data_area)
- Specifies an area into which the segment is read.
- KEYFEEDBACK(area)
- Specifies an area into which the concatenated key for the segment is placed. If the area is not long enough, the key is truncated.
- FEEDBACKLEN(expression)
- Specifies the length of the key feedback area into which you want the concatenated key retrieved. Its argument can be any expression that converts to the integer data type; you can specify either a number or a reference to a halfword in your program containing a number. (FEEDBACKLEN is required in COBOL programs and optional in PL/I and assembler language programs.)
- SEGMENT(name)
- Qualifies the command, specifying the name of the segment type you want to retrieve, insert, delete, or replace.
- SEGMENT((area))
- Is a reference to an area in your program containing the name of the segment type. You can specify an area instead of specifying the name of the segment in the command.
- WHERE(qualification statement)
- Qualifies the command, specifying the segment occurrence. Its argument is one or more qualification statements, each of which compares the value of a field in a segment to a value you supply.
- FIELDLENGTH(expression)
- Specifies the length of the field value in a WHERE option.
Usage
Use the POS
command
to:
- Retrieve the location of a specific sequential dependent segment, including the last one inserted
- Determine the amount of unused space within each DEDB area
If the area specified by the POS
command is unavailable,
the I/O area is unchanged and an FH status code is returned.
Restriction
The POS
command
is for DEDBs only.