Download User Manual

Transcript
1.
Convert all of your date data to use four-digit years and modify your
programs to process four-digit years, or
2.
Assume that certain dates are in the twentieth century and some in the
twenty-first (this is usually called date windowing).
The first solution requires that you change all Suprtool Item commands for two-digit
years to a four-digit year format. If you have not already done so, you may want to
isolate all of these Item commands in a single file per input source (e.g., one file for
every dataset in every database in your application or just one file for every
database). You can nest use-files, making this approach even easier (e.g., having one
database use-file that then includes each dataset use-file with a list of Item
commands). You may also want to use Suprtool to assist you in changing your actual
data from two-digit years to four. See "Can Suprtool Convert Two-Digit Years to
Four Digits?" on page 99 for more details.
If you do not include the century in your dates (the second solution above), you will
have the following problems:
1.
Selecting dates in yymmdd format will not produce the expected results
in relative operations (e.g., <, <=, >, or >=). You will need to change all
of your If commands to use the $stddate function.
2.
Sorting dates that include both 20th and 21st century dates, will not
collate the way most users expect, whether with Suprtool, the COBOL
sort verbs, or HPs sort tools. This is because Suprtool, and all HPsupplied tools, sort based on the numeric value of a date. To make this
work correctly within Suprtool, you will need to use the $stddate
function in an Extract command to generate a date with a four-digit
year, then sort on this new date field with another Suprtool task.
What Is Wrong with Two-Digit Years?
Currently the date format of yymmdd collates (sorts) correctly if the date is not
beyond December 31, 1999. Given the current date of 981210, numerically this is
less than next year whose date value is 991210.
At the turn of the century dates in the yymmdd format (or yymm) will no longer sort
correctly because the value of December 10, 2000 (001210) is less than 981210.
Consequently, if we have a date beyond 1999, stored in yymmdd format, a relative
operation such as:
>if date-field >= $date(98/12/10)
will not find the date of December 10, 2000. You will need to use the $stddate
function to make this task work correctly.
>if $stddate(date-field) >= $date(98/12/10)
How Do $Today and $Date Work?
Suprtool's date functions ($date and $today) are a short-hand method of generating a
numeric constant. So a date selection like:
>item invoice-date,date,YYMMDD
>if invoice-date < $today
is exactly the same as:
Suprtool Issues and Solutions
Suprtool 5.7 for MPE• 97