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: Duke Normandin
Subject: Re: [open-cobol-list] COBOL variables
Date: Wed, 12 Aug 2009 17:59:05 -0600 (MDT)
User-agent: Alpine 2.00 (OSX 1167 2008-08-23)

On Wed, 12 Aug 2009, Kevin Monceaux wrote:

> 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

Thanks Kevin! Works like a charm. I also found the following that
explains your solution.

http://www.csis.ul.ie/COBOL/Course/COBOLcommands.htm#part1

Hopefully, this resource will keep me from using this mailing list as
a COBOL language learning venue, instead of as an OpenCOBOL compiler
questions resource.
-- 
duke


reply via email to

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