bug-gnucobol
[Top][All Lists]
Advanced

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

Re: [open-cobol-list] possibly bug: accept into numeric field


From: Keisuke Nishida
Subject: Re: [open-cobol-list] possibly bug: accept into numeric field
Date: Fri Nov 7 14:56:08 2003
User-agent: Wanderlust/2.10.0 (Venus) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (Unebigoryƍmae) APEL/10.3 Emacs/21.2 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI)

At Tue, 4 Nov 2003 13:54:39 +0100,
Thomas Biehler wrote:
> 
> 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 ?! )

I checked the COBOL 2002 standard right now.  It says

| 14.8.1.3 4) a) If the size of the receiving data item [...] exceeds
| the size of the transferred data, the transferred data is stored
| aligned to the left in the receiving data item [...], and additional
| data is requested.

so the correct behavior might be to read additional characters from
the terminal.  Is this what you expect?  What other compilers do about
this?

Keisuke


reply via email to

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