SHARE
TWEET

Untitled

a guest Jul 5th, 2018 101 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. IDENTIFICATION DIVISION.
  2.     PROGRAM-ID. DATE-CONVERSION.
  3. DATA DIVISION.
  4.     WORKING-STORAGE SECTION.
  5.     01 T PIC 9(8).
  6.     01 U PIC 9(8).
  7.     01 D VALUE '999999'.
  8.         05 P PIC 9(2).
  9.         05 Q PIC 9(2).
  10.         05 R PIC 9(2).
  11.     01 F.
  12.         05 Y PIC 9(4).
  13.         05 M PIC 9(2).
  14.         05 D PIC 9(2).
  15. PROCEDURE DIVISION.
  16.     IF Q OF D > 12 THEN
  17.         MOVE FUNCTION INTEGER-OF-DATE(20000101) TO T
  18.         COMPUTE U = R OF D + 100 * ((Q OF D - 13) + 87 * P OF D) + T
  19.         MOVE FUNCTION DATE-OF-INTEGER(U) TO F
  20.         DISPLAY "Date: " Y OF F "-" M OF F "-" D OF F
  21.     ELSE
  22.         DISPLAY "Date: 19" P OF D "-" Q OF D "-" R OF D
  23.     END-IF.
  24. STOP RUN.
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top