gnucobol-users
[Top][All Lists]
Advanced

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

Re: [open-cobol-list] COBOL variables


From: Kevin Monceaux
Subject: Re: [open-cobol-list] COBOL variables
Date: Wed, 12 Aug 2009 10:45:10 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

Duke,

On Wed, Aug 12, 2009 at 08:58:51AM -0600, Duke Normandin wrote:

Try something like:

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

I changed a variable name to avoid confusion between it and the date
format.  I tried the above compiled via OpenCOBOL and the output was:

Today is 12-08-2009

In my area, I would change that to:

Today is 08-12-2009

:-)


-- 

Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.
Longum iter est per praecepta, breve et efficax per exempla!!!



reply via email to

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