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:
Format:
OUTPUT [keyword=parameter[,...]]
Syntax:
Read syntax diagramSkip visual syntax diagramOUTPUTSEGMENT= segment,Optional keyword
Optional keywords:
Read syntax diagramSkip visual syntax diagram FIELDS=(,ss:llliteralbuilt-in_variable,VL=YESNO)WHERE=(AND | ORKEYoperatordatass:lloperatordata)
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:
OUTPUT SEGMENT=SEGA,FIELDS=(1:10,15:20)
OUTPUT SEGMENT=SEGB,FIELDS=(5:200)
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.
Example 2:
OUTPUT SEGMENT=SEGA,WHERE=(1:11 EQ C'Engineering' AND 15:5 GT P'10001216')
In this example, segments with the segment name SEGA will be written to the output file when:
  • 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