Rational Developer for System z
Enterprise COBOL for z/OS, Version 4.1, Programming Guide


Sorting and merging by date

If your sort product supports the Y2PAST option and the windowed year identifiers (Y2B, Y2C, Y2D, Y2S, and Y2Z), you can perform sort and merge operations using windowed date fields as sort keys. Virtually all date fields that can be specified with a DATE FORMAT clause are supported, including binary year fields and year-last date fields.

The fields are sorted in windowed year sequence according to the century window that you specify in the YEARWINDOW compiler option. If your sort product also supports the date field identifiers Y2T, Y2U, Y2W, Y2X, and Y2Y, you can use the TRIG suboption of the DATEPROC compiler option.

The special indicators that DFSORT recognizes match exactly those supported by COBOL: LOW-VALUE, HIGH-VALUE, and SPACE for alphanumeric date or year fields, and all zeros and all nines for numeric and alphanumeric date fields that have at least one nonyear digit.

DFSORT is the IBM licensed program for sorting and merging. Wherever DFSORT is mentioned here, you can use any equivalent product.

Example: sorting by date and time

related tasks  
Sorting on windowed date fields  
DFSORT Application Programming Guide (OPTION control statement: Y2PAST)

related references  
DATEPROC  
YEARWINDOW  
Restrictions on using date fields (Enterprise COBOL Language Reference)


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)