OUTPUT subcommand
Use the OUTPUT subcommand to select the output and to specify what data from a selected segment is to be written to the output file.
OUTPUT is an optional subcommand for the EXTRACT command.
- Related keywords:
- FIELDS keyword
- SEGMENT keyword (required keyword)
- WHERE keyword
- Format:
OUTPUT [keyword=parameter[,...]]
- Syntax:
- Default:
- If the OUTPUT subcommand is not specified, one record is written for each selected segment.
Examples of OUTPUT subcommand
The OUTPUT subcommand can be specified as follows:
- Example 1:
-
In this example, only segments SEGA and SEGB will be included in the output. Data beginning at offset 1 for a length of 10, and offset 15 for a length of 20 will be included in SEGA. Data beginning at offset 5 for a length of 200 will be included in SEGB.OUTPUT SEGMENT=SEGA,FIELDS=(1:10,15:20) OUTPUT SEGMENT=SEGB,FIELDS=(5:200)
- Example 2:
-
In this example, segments with the segment name SEGA will be written to the output file when:OUTPUT SEGMENT=SEGA,WHERE=(1:11 EQ C'Engineering' AND 15:5 GT P'10001216')
- The character string 'Engineering' is found at position 1 for a length of 11
- The number at position 15 for a length of 5 is greater than the number '10001216' in packed decimal