Resolving date-related logic problems
You can adopt any of three approaches to assist with date-processing problems: use a century window, internal bridging, or full field expansion.
About this task
- Century window
- You define a century window and specify the fields that contain windowed dates. The compiler then interprets the two-digit years in these data fields according to the century window.
- Internal bridging
- If your files and databases have not yet been converted to four-digit-year dates, but you prefer to use four-digit expanded-year logic in your programs, you can use an internal bridging technique to process the dates as four-digit-year dates.
- Full field expansion
- This solution involves explicitly expanding two-digit-year date fields to contain full four-digit years in your files and databases and then using these fields in expanded form in your programs. This is the only method that assures reliable date processing for all applications.
You can use the millennium language extensions with each approach to achieve a solution, but each has advantages and disadvantages, as shown below.
Aspect | Century window | Internal bridging | Full field expansion |
---|---|---|---|
Implementation | Fast and easy but might not suit all applications | Some risk of corrupting data | Must ensure that changes to databases, copybooks, and programs are synchronized |
Testing | Less testing is required because no changes to program logic | Testing is easy because changes to program logic are straightforward | |
Duration of fix | Programs can function beyond 2000, but not a long-term solution | Programs can function beyond 2000, but not a permanent solution | Permanent solution |
Performance | Might degrade performance | Good performance | Best performance |
Maintenance | Maintenance is easier. |