Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

COBOL/400 four position DATE

171 views
Skip to first unread message

TWilly

unread,
Mar 25, 1998, 3:00:00 AM3/25/98
to

Hello,

I'm involved with a Y2K conversion effort where the majority
of the code is COBOL.

It has been a while since I used COBOL, but I'm not writing
it I'm just converting the dates.

The problem I'm having is retrieving the System Date with a four
position year.

The technique used in this code currently is:
ACCEPT xxxx FROM DATE.

This delivers a six position field in the format yymmdd.

Can I get an eight position field in the format yyyymmdd?

TIA,

Tom Tubbs

Charles M. Wilt

unread,
Mar 25, 1998, 3:00:00 AM3/25/98
to

In the ILE Cobol manual there is a reference to an IBM extension to the
ACCEPT varname FROM DATE statement.. Which provides a four digit year by
using the following.

ACCEPT varname FROM DATE YYYYMMDD.

Don't know if the standard AS/400 COBOL will accept this or not.

--
Charles Wilt
Miami Luken, Inc.
Springboro, OH. 45066
e-mail: charle...@worldnet.no.spam.att.net
--remove the .no.spam

TWilly <twi...@mindspring.com> wrote in article
<01bd5839$99abdf80$68381a26@117301>...

Robert Wieland

unread,
Mar 26, 1998, 3:00:00 AM3/26/98
to

>In the ILE Cobol manual there is a reference to an IBM extension to the
>ACCEPT varname FROM DATE statement.. Which provides a four digit year by
>using the following.
>
>ACCEPT varname FROM DATE YYYYMMDD.
>
>Don't know if the standard AS/400 COBOL will accept this or not.

NO!
---
Deutscher Ring Bausparkasse AG
Bereich Informatik
Robert Wieland
Jessenstr. 4
22756 Hamburg

Telefon: 040 / 38018 170
Fax : 040 / 38018 185

Michael Schwarze

unread,
Mar 26, 1998, 3:00:00 AM3/26/98
to Charles M. Wilt

Charles M. Wilt schrieb:

>
> In the ILE Cobol manual there is a reference to an IBM extension to the
> ACCEPT varname FROM DATE statement.. Which provides a four digit year by
> using the following.
>
> ACCEPT varname FROM DATE YYYYMMDD.
>
> Don't know if the standard AS/400 COBOL will accept this or not.
>
Accepting a four digit year only works in ILE COBOL !

In "normal" Cobol you could call a CL-PGM, which returns the system-date
in four digit notation.

0 new messages