Hi Michael,
In Cobol it is no picture for comp-1 or comp-2 field.
René
Le mercredi 6 mars 2024 à 19:44:29 UTC+1, Schmitt, Michael
<[email protected]> a écrit :
The decimal position in a COBOL field affects more than just the display*. It
also affects rounding, truncation, scaling and alignment.
For example:
Field-1 pic 99v999 value 10.100
Field-2 pic 9v9999 value 1.2345
Field-3 pic 999v99
Compute field-3 = field-1 + field-2 results in 11.33. Not 224.45.
* and it would need to be an explicit decimal (i.e. edited) to affect the
display, e.g. pic 999.99.
/pedantic_mode
-----Original Message-----
From: IBM Mainframe Assembler List <[email protected]> On Behalf
Of Gary Weinhold
Sent: Wednesday, March 6, 2024 12:03 PM
To: [email protected]
Subject: Re: Decimal Floating Point Numbers
This reminds me in a way of number representation in COBOL. The PICTURE allows
you to place the implicit decimal point anywhere, which will afftect the
display of the number, but internally there is just a fullword, or packed
decimal or halfward, etc. So the programmer choses whether to display, for
example, $12345.67 (dollars and cents) or 1234567 pennies or 12.3 Thousands of
dollars.
Where do you get to indicate whether you want LUV or RUV? Is it part of the
convert to zoned decimal or is it an convention that an application agrees on?
I can see what it is but I can't see how I can request one or the other in
assemlber language. Or is an HLL concept that some asembler subroutine
implements for the HLL?
Gary Weinhold
Senior Application Architect
DATAKINETICS | Data Performance & Optimization
Phone:+1.613.523.5500 x216
Email: [email protected]
Visit us online at http://www.dkl.com/
E-mail Notification: The information contained in this email and any
attachments is confidential and may be subject to copyright or other
intellectual property protection. If you are not the intended recipient, you
are not authorized to use or disclose this information, and we request that you
notify us by reply mail or telephone and delete the original message from your
mail system.
________________________________
From: IBM Mainframe Assembler List <[email protected]> on behalf
of Gary L Peskin <[email protected]>
Sent: March 6, 2024 11:30
To: [email protected] <[email protected]>
Subject: Re: Decimal Floating Point Numbers
Thanks, Abe. I'm glad I was able to help. I don't really understand why they
started with this whole LUV/RUV thing anyway. They could have just picked one
and said that that's the representation and left it at that (no pun intended!).
But I guess that wouldn't have been confusing enough.
Take care,
Gary