Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
000000 01 in-year pic 9(2).
000000 subtract 1 from in-year.
source was fixed to:
000000** subtract 1 from in-year.
000000 add 99 to in-year.
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. 99-Y2K.
000300 ENVIRONMENT DIVISION.
000400 CONFIGURATION SECTION.
000500 SOURCE-COMPUTER. CROX.
000600* **********************
000700* * CROX COPYRIGHT (C).*
000800* **********************
000900 OBJECT-COMPUTER. CROX.
001000 SPECIAL-NAMES.
001100 INPUT-OUTPUT SECTION.
001200 FILE-CONTROL.
001300 DATA DIVISION.
001400 FILE SECTION.
001500 WORKING-STORAGE SECTION.
001600 01 IN-YEAR PIC 99.
001700 01 TEST-INYEAR PIC S9(4) COMP.
001800 PROCEDURE DIVISION.
001900 MAIN SECTION.
002000 MAIN-000.
002001 MOVE 2000 TO IN-YEAR.
002002 SUBTRACT 1 FROM IN-YEAR.
002003 DISPLAY '1) IN-YEAR = ' IN-YEAR.
002004 MOVE 2000 TO IN-YEAR.
002005 COMPUTE IN-YEAR = IN-YEAR - 1.
002006 DISPLAY '2) IN-YEAR = ' IN-YEAR.
002007 COMPUTE IN-YEAR = IN-YEAR - 0001.00.
002008 DISPLAY '3) IN-YEAR = ' IN-YEAR.
002009
002010 PERFORM VARYING TEST-INYEAR FROM 0 BY +1 UNTIL
002020 TEST-INYEAR > +99
002030 MOVE TEST-INYEAR TO IN-YEAR
002031 DISPLAY 'new IN-YEAR IN: ' IN-YEAR WITH NO ADVANCING
002040** SUBTRACT 1 FROM IN-YEAR
002041 ADD 99 TO IN-YEAR
002051 DISPLAY ' OUT: ' IN-YEAR
002061 END-PERFORM
002161 PERFORM VARYING TEST-INYEAR FROM 0 BY +1 UNTIL
002261 TEST-INYEAR > +99
002361 MOVE TEST-INYEAR TO IN-YEAR
002461 DISPLAY 'old IN-YEAR IN: ' IN-YEAR WITH NO ADVANCING
002561 SUBTRACT 1 FROM IN-YEAR
002761 DISPLAY ' OUT: ' IN-YEAR
002861 END-PERFORM
004100 .
004200 MAIN-999.
004300 GOBACK.
004400 END PROGRAM 99-Y2K.
[\code]
The big difference is:
new IN-YEAR IN: 00 OUT: 99
old IN-YEAR IN: 00 OUT: 01
Thanks for your trick.
Regards,
Crox