IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Use of editing characters


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
brahmanandareddy

New User


Joined: 16 Dec 2004
Posts: 44
Location: Hyderabad

PostPosted: Fri Jan 20, 2006 2:21 am
Reply with quote

I have a variable of length PIC9(5).9(2).

I have given this number and I want to display the number as -124.35. How should I code the PIC clause?
Back to top
View user's profile Send private message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Fri Jan 20, 2006 2:27 am
Reply with quote

You could move this value into a variable with PIC caluse -zzz99.99
Back to top
View user's profile Send private message
brahmanandareddy

New User


Joined: 16 Dec 2004
Posts: 44
Location: Hyderabad

PostPosted: Fri Jan 20, 2006 2:38 am
Reply with quote

Hi Ramya,

Thanx for reply.

I think zzz is used for zero suppression. It suppresses zeroes to spaces. Am I right? If I am, then what is the correct solution?

Thank you,
Brahma
Back to top
View user's profile Send private message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Fri Jan 20, 2006 3:10 am
Reply with quote

You are correct....zzz is used to suppress zeroes...

since your input value is 9(5).9(2), you may have a number -0012.45 which would be displayed as -12.45 if you move into the PIC clause that I specified.

Let me know if I'm wrong.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Jan 20, 2006 7:06 am
Reply with quote

Sorry, Ramya, it doesn't work that way. If you use ----9.99 you'll get
-124.35.

It allows the sign to "float". You can do the same w/a $ sign.
Back to top
View user's profile Send private message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Fri Jan 20, 2006 8:55 am
Reply with quote

oops....i got it!
Thanks for correcting me Jack...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Count the number of characters in a f... CA Products 1
No new posts Tilde Characters Changing to COLONs i... CLIST & REXX 22
No new posts special characters pipes "|"... COBOL Programming 1
Search our Forums:

Back to Top