COMPUTE verb 
Author Message
 COMPUTE verb

Can someone point me to a good tutorial or reference source on the web, or
just quickly explain how to do rounding with the COMPUTE verb. I can't find
the info anywhere.

~Ethan



Fri, 12 Mar 2004 14:48:39 GMT  
 COMPUTE verb
On Mon, 24 Sep 2001 06:48:39 GMT, in article

Quote:

>Can someone point me to a good tutorial or reference source on the web, or
>just quickly explain how to do rounding with the COMPUTE verb. I can't find
>the info anywhere.

>~Ethan

http://publibz.boulder.ibm.com:80/cgi-bin/bookmgr_OS390/BOOKS/IGYLR20...

-------------------------------------------------
With kind regards
Daniel Jacot
-------------------------------------------------
visit us at: http://www.winterthur.com



Fri, 12 Mar 2004 15:33:39 GMT  
 COMPUTE verb


:>Can someone point me to a good tutorial or reference source on the web, or
:>just quickly explain how to do rounding with the COMPUTE verb. I can't find
:>the info anywhere.

I would suggest looking at the syntax description. You just might find a
keyword that fits your bill.

If that does not satisfy you, perhaps you might give us further details of
your homework assignment and show us what work you have done so far.

--


http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel



Fri, 12 Mar 2004 16:04:03 GMT  
 COMPUTE verb
At another site they use an acronym in these situations: RTFM.


says...

Quote:

>Can someone point me to a good tutorial or reference source on the web, or
>just quickly explain how to do rounding with the COMPUTE verb. I can't find
>the info anywhere.

>~Ethan



Sat, 13 Mar 2004 01:11:04 GMT  
 COMPUTE verb

Quote:

> Can someone point me to a good tutorial or reference source on the web, or
> just quickly explain how to do rounding with the COMPUTE verb. I can't find
> the info anywhere.

> ~Ethan

Check out 'All Things COBOL' for other links. See if you can get university
sites. Unfortunately I don't have the link but check U. of Limerick, Ireland -
they have some good demo source on-line

A very broad answer to your question :-

01 Amount1    pic 9(03)v9(02) value 12.35.
01 Amount2    pic 9(03)v9(02) value 1.23.
01 Amount3    pic 9(03)v9(02).

compute Amount3 ROUNDED = Amount1 + Amount2

BEWARE - most of the time COMPUTE works, but when you start fiddling with
fields of different sizes, with varying numbers for decimal content - you don't
always the get the answer you expected. Sometimes this necessitates splitting
the COMPUTE into several individual COMPUTEs before arriving at your final
answer.
This is not an every day problem with things like dollars and cents, but can
sure be troublesome when trying to do something like the following :-

      *-------------------------------------------------------------
      *
      *   Compute Critical  =                ( P * R )
      *                                   -----------------------------
      *                                      ( ( S * JE ) - ( P * 0.6 ) )
      *
      *-------------------------------------------------------------

You are unlikely to come up against the above at the learning stage <G>

Jimmy, Calgary AB



Sat, 13 Mar 2004 02:39:53 GMT  
 COMPUTE verb

Quote:


>> Can someone point me to a good tutorial or reference source on the web,
>> or just quickly explain how to do rounding with the COMPUTE verb. I can't
>> find the info anywhere.

>> ~Ethan

> Check out 'All Things COBOL' for other links. See if you can get
> university sites. Unfortunately I don't have the link but check U. of
> Limerick, Ireland - they have some good demo source on-line

> A very broad answer to your question :-

> 01 Amount1    pic 9(03)v9(02) value 12.35.
> 01 Amount2    pic 9(03)v9(02) value 1.23.
> 01 Amount3    pic 9(03)v9(02).

> compute Amount3 ROUNDED = Amount1 + Amount2

Scuze me?
This would accomplish WHAT?
Maybe if the operation was Division instead of
addition....

--
Jason



Sat, 13 Mar 2004 13:38:56 GMT  
 COMPUTE verb
Thanks for the help everyone...yeah I'm retarded. I found something that
said:

COMPUTE <dest> [ROUNDED] = <expression>

I thought that something more than just the word "ROUNDED" had to go there,
like some way of telling how to round. Yes I am retarded. Thanks for the
replies.

~Ethan



Quote:
> Can someone point me to a good tutorial or reference source on the web, or
> just quickly explain how to do rounding with the COMPUTE verb. I can't
find
> the info anywhere.

> ~Ethan



Sat, 13 Mar 2004 14:53:43 GMT  
 COMPUTE verb
On Mon, 24 Sep 2001 17:11:04 GMT, John H Sleight Jr

Quote:

>At another site they use an acronym in these situations: RTFM.

Which of course stands for

Read The oFficial Manual

Quote:


>says...

>>Can someone point me to a good tutorial or reference source on the web, or
>>just quickly explain how to do rounding with the COMPUTE verb. I can't find
>>the info anywhere.

>>~Ethan

     With kind Regards            |\      _,,,---,,_        
                            ZZZzz /,`.-'`'    -.  ;-;;,    
     Volker Bandke               |,4-  ) )-,_. ,\ (  `'-'  
      (BSP GmbH)                '---''(_/--'  `-'\_)        

      Crime wouldn't pay if the government ran it.

        (Another Wisdom from my fortune cookie jar)        
______________________________________________________________________________
Posted Via Binaries.net = SPEED+RETENTION+COMPLETION = http://www.binaries.net



Sat, 13 Mar 2004 22:32:25 GMT  
 COMPUTE verb
Ah, Volker, you're a master of the obvious. :)


Quote:

>On Mon, 24 Sep 2001 17:11:04 GMT, John H Sleight Jr

>>At another site they use an acronym in these situations: RTFM.

>Which of course stands for

>Read The oFficial Manual


>>says...

>>>Can someone point me to a good tutorial or reference source on the web, or
>>>just quickly explain how to do rounding with the COMPUTE verb. I can't find
>>>the info anywhere.

>>>~Ethan

>     With kind Regards            |\      _,,,---,,_        
>                            ZZZzz /,`.-'`'    -.  ;-;;,    
>     Volker Bandke               |,4-  ) )-,_. ,\ (  `'-'  
>      (BSP GmbH)                '---''(_/--'  `-'\_)        

>      Crime wouldn't pay if the government ran it.

>        (Another Wisdom from my fortune cookie jar)        
>______________________________________________________________________________
>Posted Via Binaries.net = SPEED+RETENTION+COMPLETION = http://www.binaries.net



Sun, 14 Mar 2004 00:44:45 GMT  
 COMPUTE verb

Quote:

> Thanks for the help everyone...yeah I'm retarded. I found something that
> said:

> COMPUTE <dest> [ROUNDED] = <expression>

> I thought that something more than just the word "ROUNDED" had to go there,
> like some way of telling how to round.

Well it baffled me the first time I saw it; then I realized it rounds to
the decimal significance of the <dest> field -- pretty nifty way to get
precision on the calculations and a result that adds up identically to
the display values (say for money calculations).

        Susan A



Sun, 14 Mar 2004 00:48:46 GMT  
 COMPUTE verb
John:

I thought that it stood for Read The Flexus Manual!

;-)


Quote:
>Ah, Volker, you're a master of the obvious. :)


>>On Mon, 24 Sep 2001 17:11:04 GMT, John H Sleight Jr

>>>At another site they use an acronym in these situations: RTFM.

>>Which of course stands for

>>Read The oFficial Manual


>>>says...

>>>>Can someone point me to a good tutorial or reference source on the web, or
>>>>just quickly explain how to do rounding with the COMPUTE verb. I can't find
>>>>the info anywhere.

>>>>~Ethan

>>     With kind Regards            |\      _,,,---,,_        
>>                            ZZZzz /,`.-'`'    -.  ;-;;,    
>>     Volker Bandke               |,4-  ) )-,_. ,\ (  `'-'  
>>      (BSP GmbH)                '---''(_/--'  `-'\_)        

>>      Crime wouldn't pay if the government ran it.

>>        (Another Wisdom from my fortune cookie jar)        
>>______________________________________________________________________________
>>Posted Via Binaries.net = SPEED+RETENTION+COMPLETION = http://www.binaries.net

Bob Wolfe
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When replying by e-mail, make sure that you correct the e-mail address.
Check out The Flexus COBOL Page at http://www.flexus.com


Sun, 14 Mar 2004 02:23:39 GMT  
 COMPUTE verb
RT,

Who wudda thunk?


Quote:

>John:

>I thought that it stood for Read The Flexus Manual!

>;-)


>>Ah, Volker, you're a master of the obvious. :)


>>>On Mon, 24 Sep 2001 17:11:04 GMT, John H Sleight Jr

>>>>At another site they use an acronym in these situations: RTFM.

>>>Which of course stands for

>>>Read The oFficial Manual


>>>>says...

>>>>>Can someone point me to a good tutorial or reference source on the web, or
>>>>>just quickly explain how to do rounding with the COMPUTE verb. I can't find
>>>>>the info anywhere.

>>>>>~Ethan

>>>     With kind Regards            |\      _,,,---,,_        
>>>                            ZZZzz /,`.-'`'    -.  ;-;;,    
>>>     Volker Bandke               |,4-  ) )-,_. ,\ (  `'-'  
>>>      (BSP GmbH)                '---''(_/--'  `-'\_)        

>>>      Crime wouldn't pay if the government ran it.

>>>        (Another Wisdom from my fortune cookie jar)        
>>>______________________________________________________________________________
>>>Posted Via Binaries.net = SPEED+RETENTION+COMPLETION = http://www.binaries.net

>Bob Wolfe
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>When replying by e-mail, make sure that you correct the e-mail address.
>Check out The Flexus COBOL Page at http://www.flexus.com



Sun, 14 Mar 2004 03:56:39 GMT  
 COMPUTE verb

Quote:

> John:

> I thought that it stood for Read The Flexus Manual!

> ;-)

Seems to me I just read elsewhere that you *promised* one more plug for SP2 - then
you would shut up <G>

Jimmy



Sun, 14 Mar 2004 05:34:54 GMT  
 COMPUTE verb

Quote:


> > Thanks for the help everyone...yeah I'm retarded. I found something that
> > said:

> > COMPUTE <dest> [ROUNDED] = <expression>

> > I thought that something more than just the word "ROUNDED" had to go there,
> > like some way of telling how to round.

> Well it baffled me the first time I saw it; then I realized it rounds to
> the decimal significance of the <dest> field -- pretty nifty way to get
> precision on the calculations and a result that adds up identically to
> the display values (say for money calculations).

>         Susan A

As a result of Jason's message it baffled me too ! Nah this rocket scientist
hadn't come up with something nifty Susan. I goofed. That's what happens when you
shoot from the lip <G>. This is what I was trying to convey, and I've compiled it
this time to make damn sure :-.
*>----------------rounded1.cbl ---------------------------------
01 Amount1              pic 9(03)v9(03) value 12.356.
01 Amount2              pic 9(03)v9(03) value  1.236.
01 Amount3              pic 9(03)v9(02).

compute Amount3 rounded = Amount1 + Amount2.  *> = 013.59
*>--------------------------------------------------------------

BTW the above is the complete program in Net Express. Do wish we could get rid of
that red tape jazz when it isn't required.

Jimmy



Sun, 14 Mar 2004 05:43:21 GMT  
 COMPUTE verb

Quote:


>> John:

>> I thought that it stood for Read The Flexus Manual!

>> ;-)

>Seems to me I just read elsewhere that you *promised* one more plug for

(partial message text deleted to protect the innocent)

Quote:
>- then you would shut up <G>

Jimmy:

That was in a different place.  Besides....I don't see that product
name anywhere in my reply...even in THIS one!

;-)

Bob Wolfe
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When replying by e-mail, make sure that you correct the e-mail address.
Check out The Flexus COBOL Page at http://www.flexus.com



Sun, 14 Mar 2004 21:14:03 GMT  
 
 [ 18 post ]  Go to page: [1] [2]

 Relevant Pages 

1. Parallel Computing and Distributed computing

2. To compute, or not to compute ...

3. Optical Computing: special issue - Natural Computing, Springer

4. Optical Computing: special issue - Natural Computing, Springer

5. Optical Computing: special issue - Natural Computing, Springer

6. Parsing Verbs

7. NB. gray.js: a J verb that generates a grayscale postscript image from a 2d array

8. The verb you asked for

9. More questions about implementing modified verbs

10. Documentation and foreign verbs

11. Efficient combinations verb

12. More efficient combinations verb

 

 
Powered by phpBB® Forum Software