View previous topic :: View next topic
|
Author |
Message |
satish kanamarlapudi
New User
Joined: 23 Jul 2008 Posts: 29 Location: Little Rock - Arkansas
|
|
|
|
Hi,
I had a requirement where in the output field instead of getting 0.00 which is declared as s9(13)v(02) comp-3, i should get the output as 0 only.
I tried giving it as z(08)vz(02) but it is coming as 0.00.
Please help me out in this.
Thx,
satish |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
I tried a few options (like MOVE'0' TO WS-AMOUNT-EDIT) but it didn't help.
I would do with plain cobol:
Code: |
01 WS-AMOUNT.
03 WS-AMOUNT-EDIT PIC z(8).9(2).
IF my-amount = 0 THEN
MOVE ' 0' TO WS-AMOUNT
ELSE
MOVE my-amount TO WS-AMOUNT-EDIT
END-IF |
(I think the 0 should be on the right) |
|
Back to top |
|
|
muthuvel
Active User
Joined: 29 Nov 2005 Posts: 217 Location: Canada
|
|
|
|
Satish,
Is it specific to zero or any numbers which have no decimal part like 13.00 as 13 and so on?
If yes,then you have to compare the decimal part of your number and if it is 00,you have to move the number to a numeric variable which has no declaration of decimals.
Hope this helps. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
This:
Code: |
01 Y PIC ZZ,ZZZ,ZZZ.BB-.
*
PROCEDURE DIVISION.
0000-MAINLINE.
MOVE 0123.00 TO Y.
DISPLAY Y.
GOBACK. |
gives:
Will this do what you want? |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
I think satish needs to answer muthuval's question before we can offer any more suggestions. |
|
Back to top |
|
|
|