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: William M. Klein
Subject: RE: [open-cobol-list] possibly bug: accept into numeric field
Date: Tue Nov 11 16:35:08 2003

I haven't followed ALL of this thread, but I did want to make certain that
everyone reading this understands what the '85 ANSI/ISO Standard says about
this.  

On page VI-71  GR(2) says,

"(2) The implementor will define, for each hardware device, the size of a
data transfer.

Then GR4a goes on to say,

"a. If the size of the receiving data item (or of the portion of the data
item not yet currently occupied by transferred data)lexceeds the the
transferred data, the transferred data is stored aligned to the left
receiving data item (or the portion of the receiving data item not yet
occupied), and additional data is requested. In level 1, only one transfer
of provided."

It is worth noting:

A) This wording remains the same in the 2002 Standard
B) It is "fairly" clear that you left align and do NOT numeric justify when
doing an ACCEPT from a "smaller" to a "larger" field.

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On 
> Behalf Of Alain Lucari
> Sent: Tuesday, November 11, 2003 5:54 AM
> To: address@hidden
> Subject: Re: [open-cobol-list] possibly bug: accept into numeric field
> 
> 
> Le Tue, 11 Nov 2003 10:43:55 +0900
> Keisuke Nishida <address@hidden> a écrit:
> 
> > 
> > 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 suppose that the quotes are just for explanation and not typed,
> IMHO exactly 23, 010 and 23V4 with numerics receivers above
> or "12", "1  ", "123" if the receivers are pic XX and XXX
>  and "123.4" if the receiver is PIC X(5)
> exactly like from a move.
> 
> Regards,
> -- 
> Alain Lucari (Eurlix)
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: ApacheCon 2003,
> 16-19 November in Las Vegas. Learn firsthand the latest
> developments in Apache, PHP, Perl, XML, Java, MySQL,
> WebDAV, and more! http://www.apachecon.com/
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
> https://lists.sourceforge.net/lists/listinfo/open-cobol-list
> 




reply via email to

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