How can I convert 2 digit year to 4 digit with VISION:Two?
search cancel

How can I convert 2 digit year to 4 digit with VISION:Two?


Article ID: 31710


Updated On:





How can I convert 2 digit year to 4 digit with VISION:Two?



Dates in user data that have 2 digit years can be easily converted to 4 digit year format.  Using the VISION:Two DATE field type, the century can be added to numeric format (zoned or packed), date fields without taking any more storage or rearranging other fields in the file definition.  If the original fields are numeric format, no changes need be made to the application. 


1.      Change the file definition L0 statements for old date field to rename them to DATEOLDn. 
         Overdefine the old date field with a new field with the original name, using field type D, length 4. 

2.       Create a simple application with the following procedure:

                             LET O.originalname = O.DATENEWn + 190000
                                            (repeat this LET statement for each date field)

3.        Add an RF statement to specify a subfile.
           Add an En to write the subfile with NR in columns 41/42,
           O in column 43 to specify the entire old master record be written to the subfile,
           columns 44-51 contain the ddname specified on the RF statement.
           Column 56 indicates the subfile format and should match the format of the input master file. 

4.        After execution, delete the L0 statements with names DATEOLDn. 

If the original fields are character, it is likely they are overdefined with the YY MM DD components and/or partial fielding is used in the application.  If you use the above procedure, applications will need to be modified to move the new date field to a temporary character field before partial fielding is allowed and field qualifiers must be changed to T.


Component: V:TWO