In article <[log in to unmask]>, Michael Berkowitz
<[log in to unmask]> writes
>The URL http://www.software.ibm.com/ad/va2000/va2k2mle.htm
>has a brilliant idea from IBM called the Millennium Language Extensions.
>In essence, you put a $Control statement that says the starting year of
>your 100 year window, and in the Data Division, you add a clause to the
>PIC that says the field is a date and what format. Then the compiler and
>run time library automatically expand the date to 8 characters for less
>than and greater than comparisions. I don't think it handles a sort though.
>
>Example:
>
>77 DATE-IN PIC X(6) VALUE "971022". << OCT 22, 1997 >>
>77 DATE-DUE PIC X(6) VALUE "010429". << APR 29, 2001 >>
>
>IF DATE-IN > DATE-DUE
> DISPLAY "YOU ARE OVER DUE, DUE ON " DATE-DUE
>ELSE
> DISPLAY "NOT OVERDUE YET".
>
>When this executes the first display will erroneously occur.
>
>
>With IBM Millennium Language Extension.
>$CONTROL WINDOW=1950
>77 DATE-IN PIC X(6) VALUE "971022" DATE YYMMDD.
>77 DATE-DUE PIC X(6) VALUE "010429" DATE YYMMDD.
> | new clause
> |
>IF DATE-IN > DATE-DUE
> DISPLAY "YOU ARE OVER DUE, DUE ON " DATE-DUE
>ELSE
> DISPLAY "NOT OVERDUE YET".
>
>When this executes, the compiler and run-time library will make 8
>character dates for comparision, and correctly cause the second display
>to occur.
>
>At IBM, these extensions are available for COBOL on OS/390, VM, VSE,
>and AIX, VisualAge COBOL on OS/2 and Windows NT and PL/1 on MVS,
>VM and AIX. Adding this feature to the HP compilers and run-time
>libraries would make Y2K conversions so much faster and accurate for
>those shops using the century window concept.
>
>Mike Berkowitz
>Guess? Inc.
I need my Shipping Tickets printed 4 working days before Date Due. I
don't think it will figure that for me :-(
--
Roy Brown Phone : (01684) 291710 Fax : (01684) 291712
Affirm Ltd Email : [log in to unmask]
The Great Barn, Mill St 'Have nothing on your systems that you do not
TEWKESBURY GL20 5SB (UK) know to be useful, or believe to be beautiful.'
|