Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

supression of zeroes

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
satish kanamarlapudi

New User


Joined: 23 Jul 2008
Posts: 29
Location: Little Rock - Arkansas

PostPosted: Wed Dec 31, 2008 1:10 pm    Post subject: supression of zeroes
Reply with quote

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
View user's profile Send private message

Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1226
Location: Israel

PostPosted: Wed Dec 31, 2008 4:00 pm    Post subject:
Reply with quote

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
View user's profile Send private message
muthuvel

Active User


Joined: 29 Nov 2005
Posts: 217
Location: Chennai

PostPosted: Wed Dec 31, 2008 4:56 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Dec 31, 2008 10:40 pm    Post subject:
Reply with quote

Hello,

This:
Code:
       01  Y                 PIC ZZ,ZZZ,ZZZ.BB-.     
                                                     
      *                                               
       PROCEDURE DIVISION.                           
       0000-MAINLINE.                                 
           MOVE 0123.00 TO Y.                         
           DISPLAY Y.                                 
           GOBACK.     

gives:
Code:
     123. 


Will this do what you want?
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Dec 31, 2008 11:34 pm    Post subject:
Reply with quote

I think satish needs to answer muthuval's question before we can offer any more suggestions.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add Trailing Zeroes depending upon th... Rohit Umarjikar DFSORT/ICETOOL 3 Fri Oct 23, 2015 1:47 am
No new posts To insert zeroes in a PIPE delimited ... dharmaraok DFSORT/ICETOOL 3 Mon Mar 16, 2015 3:05 pm
No new posts CSV file , to display numeric data w... Deepthy Jose P JCL & VSAM 10 Fri Nov 21, 2014 12:50 pm
No new posts Spaces instead of zeroes in Totaled f... saurabh39 CA Products 3 Fri Feb 14, 2014 2:16 pm
No new posts Suppress trailing zeroes in CH field ... zh_lad DFSORT/ICETOOL 10 Tue Feb 11, 2014 4:59 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us