FDREPORT SORT Statement
SORT statement
The SORT statement specifies the fields to be used to sort the data selected. You can specify one or more fields to be used for the sort. Most of the fields that can be reported on can be selected whether or not that field is to be printed.
If this statement is not specified, the SORT=COMBINE and SORT=YES options on the PRINT and DEFAULT statements, and several other reporting options that require sorting, invoke sorting with default sorting parameters.
Sorting may require that you specify certain DD statements for your SORT product (see FDREPORT-JCL-Requirements) or FDREPORT may dynamically allocate all required SORT files (see “SORTALLOC=” in FDREPORT-TITLE-Statement).
The “FDREPORT BREAK Statement” in FDREPORT-HEADING-Statement provides a simpler alternative to the SORT statement when all fields are to be sorted in ascending order and a standard control break is to be taken on every field.
SORT statement syntax
SORT | FIELDS=(field1[,field2,…]) |
---|---|
,BREAK=({EJ|NO|RPM|SEJ|SP|SSP|SUB|YES}[,…]) | |
,LENGTH=(nnn[,nnn,…]),OFFSET=(nnn[,nnn,…]) | |
,RESET|NORESET | |
,SEQUENCE=({A|D}[,…]) |
FIELDS=
Specifies one or more fields to be used by FDREPORT for the SORT. If more than one field is specified, they are sorted in the order specified.
The tables in FDREPORT-Field-Names document the available field names; check the SORT column to see which are supported for sorting.
SEQUENCE=
Specifies the SEQUENCE in which the corresponding SORT field is to be sorted.
Ascending sequence.
Descending sequence.
If more than one field was specified, each value coded is associated with the relative position of the field specified.
For example, if FIELDS=(A,B,C) is specified with SEQUENCE=(D,A,D), field A is sorted descending, field B ascending, and field C descending.
Default: A (ascending).
BREAK=
Specifies if a change in the value of a SORT FIELD is to cause a control break, and what action to take at that break.
Page eject only.
No control break.
Reset punch mask (re-initialize punch mask processing, see FDREPORT-PRINT-Statement).
Subtotal summary fields and page eject.
Space one line only.
Subtotal summary fields and space one line.
Subtotal summary fields.
Subtotal summary fields, space one line, and reset punch mask.
If more than one field was specified, each value coded is associated with the relative position of the field specified.
For example, if FIELDS=(A,B,C) is specified with BREAK=(YES,NO,SSP), a change in field A does summary processing, field B does not, and field C causes subtotals with a blank line.
Default: NO for all fields.
LENGTH=
Specifies the lengths to be used in conjunction with an offset operand.
If the corresponding LENGTH= value for an OFFSET= is not given, the command is marked in error. If a LENGTH= value is given without a corresponding OFFSET=, the command is marked in error.
OFFSET=
nnn
Specifies the offset within a DSCB to be used as a sort control. The OFFSET= must be in the range of 0 to 104; extent descriptor fields are not supported. If the corresponding LENGTH= value for an OFFSET= is not given, the command is marked in error.
RESET
NORESET
Indicates that these fields should be added to the list of fields currently in effect from preceding SORT or BREAK statements.
Indicates that the list of fields on this SORT statement completely replaces the values on any preceding SORT or BREAK statement.
Default: RESET.