For Programmers: Free Programming Magazines  


Home > Archive > Cobol > September 2007 > small value problem









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author small value problem
Szymon

2007-09-25, 7:55 am

Hi,
I keep on trying to compile this part of a program:


000121 WORKING-STORAGE SECTION.
000122 01 NUMBER_1 PIC 9(2) VALUE 23.06.
000123 01 NUMBER_2 PIC 9(2) VALUE 543.07.



and still get the same error about the second and third line:

NUMERIC LITERAL OF VALUE CLAUSE IS SPECIFIED FOR VALUE WHICH IS
TRUNCATED TO EXCEPT ZERO. FIGURATIVE CONSTANT 'ZERO' ASSUMED SPECIFIED.
HeyBub

2007-09-25, 7:55 am

Szymon wrote:
> Hi,
> I keep on trying to compile this part of a program:
>
>
> 000121 WORKING-STORAGE SECTION.
> 000122 01 NUMBER_1 PIC 9(2) VALUE 23.06.
> 000123 01 NUMBER_2 PIC 9(2) VALUE 543.07.
>
>
>
> and still get the same error about the second and third line:
>
> NUMERIC LITERAL OF VALUE CLAUSE IS SPECIFIED FOR VALUE WHICH IS
> TRUNCATED TO EXCEPT ZERO. FIGURATIVE CONSTANT 'ZERO' ASSUMED
> SPECIFIED.


You can't fit 543+ pounds of stuff in a 99-pound bag.

Think: PIC 9(3)V9(2).


Doug Miller

2007-09-25, 7:55 am

In article <fdarcu$533$1@inews.gazeta.pl>, Szymon <alpha@skynet.org.pl_WITHOUT> wrote:
>Hi,
>I keep on trying to compile this part of a program:
>
>
>000121 WORKING-STORAGE SECTION.
>000122 01 NUMBER_1 PIC 9(2) VALUE 23.06.
>000123 01 NUMBER_2 PIC 9(2) VALUE 543.07.


You need to review the description of the PICTURE clause in your
textbook. You appear to be under the impression that PIC 9(2) describes a
numeric item with two decimal places. It does not.

--
Regards,
Doug Miller (alphag at milmac dot com)

It's time to throw all their damned tea in the harbor again.

2007-09-25, 7:55 am

In article <fdarcu$533$1@inews.gazeta.pl>,
Szymon <alpha@skynet.org.pl_WITHOUT> wrote:
>Hi,
>I keep on trying to compile this part of a program:


Please do your own homework.

DD
donald tees

2007-09-25, 7:55 am

Szymon wrote:
> Hi,
> I keep on trying to compile this part of a program:
>
>
> 000121 WORKING-STORAGE SECTION.
> 000122 01 NUMBER_1 PIC 9(2) VALUE 23.06.
> 000123 01 NUMBER_2 PIC 9(2) VALUE 543.07.
>
>
>
> and still get the same error about the second and third line:
>
> NUMERIC LITERAL OF VALUE CLAUSE IS SPECIFIED FOR VALUE WHICH IS
> TRUNCATED TO EXCEPT ZERO. FIGURATIVE CONSTANT 'ZERO' ASSUMED SPECIFIED.


You have defined them as two digit integers, and then given a fractional
value in one case, and a three digit fractional value in the second.

Donald
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com