gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[open-cobol-list] COBOL variables


From: Duke Normandin
Subject: [open-cobol-list] COBOL variables
Date: Wed, 12 Aug 2009 08:58:51 -0600 (MDT)
User-agent: Alpine 2.00 (OSX 1167 2008-08-23)

Hello list....

noob here!  ;)

In the following snippet, I'd like to change YY so that it will accept
all four digits for the "year" so that the output reads:

12-08-2009

OOOO10 ID DIVISION.
000015 PROGRAM-ID. HELLO3.
000020 AUTHOR. Duke Normandin.
000030 DATA DIVISION.
000035 WORKING-STORAGE SECTION.
000040 01 YYMMDD.
000060    05 YY   PIC   9(2).
000070    05 MM   PIC   99.
000080    05 DD   PIC   99.
000150 PROCEDURE DIVISION.
000160 MAIN-PARA.
000170    ACCEPT YYMMDD FROM DATE.
000180    DISPLAY 'Hello, Cruel World!'.
000190    DISPLAY 'Today is ' DD '-' MM "-" YY.
000200    STOP RUN.


I've tried:

 05  YY  PIC 9(4).
 05  YY  PIC 9999.

but nothing seems to work! I don't believe that I need to change YY to
YYYY because it's just a new -- right?
-- 
duke


reply via email to

[Prev in Thread] Current Thread [Next in Thread]