Converting Year Data with Century Window Processing on INREC, OUTREC, or OUTFIL OUTREC - 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-08-27
Published on
2024-08-27T08:14:56.318001

A 2-digit year-only field, as specified by the Y2B, Y2C, Y2D, Y2P, Y2S, Y2Z, Y2ID, and Y2IP formats, can be converted on output to a 4-digit year.

The following describes output data conversion for 2-digit year-only date fields:

  • The Y2B format specifies 2-digit, 1-byte binary year data that will be converted to a 4-digit, displayable character format with the appropriate century value. For information on the range of binary values representing year data with Y2B, see table Possible Values Representing Year Data with Y2B.

  • The Y2C and Y2Z formats specify 2-digit year data that are in displayable (zoned decimal) format. The 2-digit year data will be expanded to a 4-digit field containing the appropriate century value.

  • The Y2S format is equivalent to Y2C and Y2Z for valid numeric year data. All three formats will convert such data to a displayable 4-digit year with the appropriate century value. Y2S, however, provides additional functionality. For data with binary zeros (X'00'), a blank (X'40') or binary ones (X'FF') in the first byte, typically to identify header/trailer records, Y2S will expand the data to 4 bytes, padded in the first 2 bytes with the same character as found in the first byte of the input field. The fourth byte of the output field is copied unchanged from the second byte of the input field.

The following symbolic representation shows the treatment in hexadecimal of the three types of data:

  • The Y2D and Y2P formats specify 2-digit year values in packed decimal format. The processing applied to these fields will create a 4-digit year value converted to a displayable character format.

  • The Y2ID and Y2IP formats take as input the same 2-digit packed decimal year data as the Y2D and Y2P formats but produce a 4-digit year output that remains in packed decimal format. Y2ID will convert data from X'yy' to X'ccyy', and Y2IP will convert data from X'ayys' to X'accyys', where cc is the correct century. (For a description of Y2D and Y2P formats, see The Y2D Format and The Y2P Format.

For full-date fields with 2-digit years (Y2T, Y2U, Y2V, Y2W, Y2X, and Y2Y), the 2-digit portion will expand to the appropriate 4-digit year based on the CENTWIN setting. When doing a simple p,l,f conversion to a printable format, the output field length can be determined from Data Conversion Table – Full-Date Formats. Conversion to other formats can be done using the DT, DTNS, TOJUL or TOGREG parameters.

Note that an additional data format, PD0, which is typically used to process the month and day portion of packed decimal data, is not affected by CENTWIN processing and will not convert 2-digit year data to 4-digit years. PD0 can be used with the MFX-supplied edit mask M11. The year data formats Y2B, Y2C, Y2D, Y2P, and Y2Z or the full-date formats Y2T, Y2U, Y2V, Y2W, Y2X, and Y2Y can also be used when forming expressions. The 4-digit year for year data formats or the full date data for the full-date formats will be converted to an integer for arithmetic calculations. Any expression with these formats can also be converted to an output numerical data format fo or to printable output by specifying one or more of the OUTREC FIELDS subparameters (Mm, EDIT, SIGNS, or LENGTH). For information on using the year data formats for SORT or MERGE field specifications, see CENTWIN Parameter (Optional) or CENTWIN Parameter (Optional), respectively. For more information on using the year data formats for INREC or OUTREC processing, see Example 5.

For more information on converting full-date formats, see the descriptions of the fi and fy2f,(c) parameters, in the table Full-Date Field Conversions, and Data Conversion Table – Full-Date Formats.