Examples Using Full-Date Formats - mfx - 3.1

Syncsort™ MFX Programmers Guide

Product type
Software
Portfolio
Integrate
Product family
Syncsort™ Software
Product
Syncsort™ MFX > MFX
Version
3.1
Language
English
Content type
Programmer’s Guide
Product name
Syncsort™ MFX
Title
Syncsort™ MFX Programmers Guide
Copyright
2024
First publish date
2010
Last updated
2024-11-06
Published on
2024-11-06T17:38:26.716054

Example 1 (Y2W)

The following SORT control statement sorts a C'mmddyy' date field in ascending order, with the previously set fixed century window 1984-2083:
SORT FIELDS=(10,6,Y2W,A) * Sort C'mmddyy' in ascending order
* with Y2W
* and previously set century window 1984-2083

The Full-Date Formats table above indicates that the 6-byte Y2W form is appropriate for a CH input field of the form xxxxyy. As shown in the following table, the output will be collated as C'yyyymmdd', with the non-date data (zeros) appearing correctly at the beginning of the sorted output.

Example 2 (Y2T)

The following SORT control statement sorts a Z'yyddd' date field in descending order, with the previously set fixed century window 1921-2020:
SORT FIELDS=(20,5,Y2T,D) * Sort Z'yyddd' in descending order
* with Y2T
* and previously set century window 1921-2020

The Full-Date Formats table above indicates that the 5-byte Y2T form is appropriate for a ZD input field of the form yyddd. As shown in the following table, the output will be collated as Z'yyyyddd', with the non-date data (nines and zeros) appearing correctly at the beginning and end of the sorted output.

SORTIN

Input

Record Order

after Sorting

Actual Date

after Sorting

yyddd

yyddd

yyyy/ddd

 00000

99999

non-date data

50237

20153

2020/153

99999

20047

2020/047

20047

01223

2001/223

94001

94001

1994/001

01223

50237

1950/237

20153

21148

1921/148

21148

00000

non-date data

Example 3 (Y2Y)

The following SORT control statement sorts a P'mmddyy' (X'0mmddyys') date field in ascending order, with the previously set fixed century window 1921-2020:
SORT FIELDS=(26,4,Y2Y,A) * Sort P'mmddyy' in ascending order
* with Y2Y
* and previously set century window 1921-2020

The Full-Date Formats table above indicates that the 4-byte Y2Y form is appropriate for a PD input field of the form xxxxyy. As shown in the following table, the output will be collated as P'yyyymmdd', with the non-date data (zeros and nines) appearing correctly at the beginning of the sorted output. Note that the first two columns are in hexadecimal.