[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[open-cobol-list] possibly bug: accept into numeric field
From: |
Thomas Biehler |
Subject: |
[open-cobol-list] possibly bug: accept into numeric field |
Date: |
Tue Nov 4 04:57:10 2003 |
User-agent: |
KMail/1.4.3 |
Hi all,
i am not sure, but there is possibly a bug in open-cobol
in the accept statement.
The problematic case is an accept into a numeric field
when inputing less characters as in PICTURE-SIZE given.
The actual behaviour is the alignment to left (ok!) and
the filling up to the SIZE of the field with SPACES! ( IMO not ok)
I read in both ANSI-Standards (1985 / 2002) about the ACCEPT-Statement.
As far as i unterstand it, only the left alignment is ok.
These standards are saying nothing about "alphanumeric fillup".
(The MICRO-FOCUS Compiler does not makes the "alphanumeric fillup"
but IMHO the ANSI-Cobol Standards are not very precise in the Specfication
of the ACCEPT - "Format 1"; perhaps it is question of interpretation ?! )
cobc -std=cobol85 -fixed acceptbug.cob
CASE 1) Input is a single "0":
... ./acceptbug
COMPARE IS = 0
PLEASE GIVE IN ZERO:
0
INPUT WAS NOT = 0
COMPARE IS <= 0
PLEASE GIVE IN ZERO:
0
INPUT WAS <= 0
-------------------------------------------------------------------------------------------
CASE 2) Input are four "0":
... ./acceptbug
COMPARE IS = 0
PLEASE GIVE IN ZERO:
0000
INPUT WAS = 0
COMPARE IS <= 0
PLEASE GIVE IN ZERO:
0000
INPUT WAS <= 0
I am interessed what you say about this issue.
Bye
Thomas
acceptbug.cob
Description: Text document
- [open-cobol-list] possibly bug: accept into numeric field,
Thomas Biehler <=
- 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, 2003/11/11