[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [open-cobol-list] possibly bug: accept into numeric field
From: |
Bernard Giroud |
Subject: |
Re: [open-cobol-list] possibly bug: accept into numeric field |
Date: |
Tue Nov 11 06:15:06 2003 |
********************************************************************************
This e-mail contains confidential information or information belonging
to the Credit Lyonnais Group entity sending it and is intended solely
for the addressees. Any views expressed in this message are those of
the individual sender and its contents do not constitute a commitment
by Credit Lyonnais unless confirmed by letter or fax. The unauthorised
disclosure, use, dissemination or copying (either whole or partial) of
this e-mail, or any information it contains, is prohibited. E-mails are
susceptible to alteration and their integrity cannot be guaranteed.
Internet communications are not secured and therefore Credit Lyonnais
shall not be liable for this e-mail if modified or falsified. If you
are not the intended recipient of this e-mail, please delete it
immediately from your system and notify the sender of the wrong
delivery and the mail deletion.
********************************************************************************
Results with OpenVMS/Alpha Compaq COBOL V2.7:
PLEASE GIVE IN VALUE 123 in X-1 (PIC 99) :
123
VALUE OF X-1: /12/
PLEASE GIVE IN VALUE 1 in X-2 (PIC 99V9) :
1
VALUE OF X-2: /1 /
PLEASE GIVE IN VALUE 123.4 in X-3 (PIC 99V9) :
123.4
VALUE OF X-3: /123/
For Jeff,
Notice that TC does a numeric move for all three tests,
and I bet it does an alpha move if the picture is X.
In any case, IMO the best behavior is the one from the
DPS-7000.
Bernard Giroud
Credit Lyonnais (Suisse) SA
----- Original Message -----
From: "Thomas Biehler" <address@hidden>
To: "Keisuke Nishida" <address@hidden>
Cc: <address@hidden>
Sent: Tuesday, November 11, 2003 2:25 PM
Subject: Re: [open-cobol-list] possibly bug: accept into numeric field
On Tuesday 11 November 2003 02:43, you wrote:
> At Mon, 10 Nov 2003 18:24:37 +0100,
>
> Thomas Biehler wrote:
> > The intuitive behaviour: (conform to ... ?!)
> > ==============================
> > From the user sight it looks like a
> > numeric MOVE from a shorter Field to a longer Field !!!!
> > (Right alignment , Fillup with Zero's)
> > But only one request to the User is made
> > (ACCEPT from Terminal / SYSIN / Console ...)
> > = only one Transfer of Data !?
>
> What results do you suppose to obtain (or do you get
> from other compilers) by the following ACCEPT?
>
> Data item Input
> --------- -----
> 01 X-1 PIC 99. "123"
> 01 X-2 PIC 99V9. "1"
> 01 X-3 PIC 99V9. "123.4"
>
> Maybe "23", "010", and "234"? But it seems the standard
> requires X-1 to be "12". (At leat the NIST Test Suite has
> a test for this.) Gee.
>
> > I hope, it is now clear why i can not say
> > what I expect, only in a simple sentence.
> > I don't now what i should request from you.
> > (I have some ideas but i would like to see your answer first)
> > In general, i like compiler that follows standards !
> > (And i like good standards too :-) )
>
> I'd like to implement a compiler that follows standards
> by default, while I'd like to make it compatible with
> other COBOL compilers by giving appropriate options.
>
> Keisuke
Hi Keisuke,
i have tested your questions with the attached program "accepttest.cob"
(So can other users easy test it with other compiler's and send the
results!)
But after visiting the results i must repeat me!
Finding out what "the standard" (really) means and implement it
should be the very first step. After that, other "important
compiler-dialects"
could (or shoúld ?) be supported. (or the "average of all" :-) )
A remark to my descripition of the "intuitive" behavior ;-)
The "numeric MOVE" describes only for the special case from
shorter numeric source to a longer receiving numeric field!
Take a precise look at the following results:
COBOL-85 Compiler on DPS-7000 (GCOS-7) System: (handy programmed tests)
====================================================
Data-Item Input
01 X-1 PIC 99. 123
==> Result: Error-Message : "Maximum Value 99: Please reenter"
01 X-2 PIC 99V9. 1
==> Result: 010 (as expected)
01 X-3 PIC 99V9. 123.4
==> Result: Error-Message : "Maximum Value 99.9: Please reenter"
current CVS-Version from Open-cobol:
===================================================
PLEASE GIVE IN VALUE 123 in X-1 (PIC 99) :
123
VALUE OF X-1: /12/
PLEASE GIVE IN VALUE 1 in X-1 (PIC 99V9) :
1
VALUE OF X-2: /1 .0/ <=== the bug
PLEASE GIVE IN VALUE 123.4 in X-3 (PIC 99V9) :
123.4
VALUE OF X-3: /12.3/ <=== ???
tiny-cobol 0.61 (with some but not all updates from CVS)
===================================================
PLEASE GIVE IN VALUE 123 in X-1 (PIC 99) :
123
VALUE OF X-1: /23/ <=== Ooops!
PLEASE GIVE IN VALUE 1 in X-2 (PIC 99V9) :
1
VALUE OF X-2: /01.0/
PLEASE GIVE IN VALUE 123.4 in X-3 (PIC 99V9) :
123.4
VALUE OF X-3: /23.4/ <=== ???
Micro Focus OCDS 4.2 (LINUX)
=====================================================
PLEASE GIVE IN VALUE 123 in X-1 (PIC 99) :
123
VALUE OF X-1: /12/
PLEASE GIVE IN VALUE 1 in X-2 (PIC 99V9) :
1
VALUE OF X-2: /010/
PLEASE GIVE IN VALUE 123.4 in X-3 (PIC 99V9) :
123.4
VALUE OF X-3: /230/ <== Ooops !!!!!!!! ??
I am sure,
as more compiler will be tested,
as more different results will comming.
It seems so, that other people has also problems
to unterstand "the standard" in the "ACCEPT - Format-1".
What do you think about starting a thread
in the comp.lang.cobol newsgroup?
Bye
Thomas
- [open-cobol-list] possibly bug: accept into numeric field, Thomas Biehler, 2003/11/04
- Re: [open-cobol-list] possibly bug: accept into numeric field, Keisuke Nishida, 2003/11/07
- Re: [open-cobol-list] possibly bug: accept into numeric field, Thomas Biehler, 2003/11/10
- Re: [open-cobol-list] possibly bug: accept into numeric field, Keisuke Nishida, 2003/11/10
- Re: [open-cobol-list] possibly bug: accept into numeric field, masterok, 2003/11/11
- Re: [open-cobol-list] possibly bug: accept into numeric field, Alain Lucari, 2003/11/11
- RE: [open-cobol-list] possibly bug: accept into numeric field, William M. Klein, 2003/11/11
- Re: [open-cobol-list] possibly bug: accept into numeric field, Alain Lucari, 2003/11/12
- [open-cobol-list] MOVE Statement (was: possibly bug: accept into numeric field, William M. Klein, 2003/11/12
- Re: [open-cobol-list] possibly bug: accept into numeric field, Thomas Biehler, 2003/11/11
- Re: [open-cobol-list] possibly bug: accept into numeric field,
Bernard Giroud <=
- Re: [open-cobol-list] possibly bug: accept into numeric field, Keisuke Nishida, 2003/11/14
- Re: [open-cobol-list] possibly bug: accept into numeric field, Alain Lucari, 2003/11/14