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
 

 

To display packed decimal with sign

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

New User


Joined: 20 Nov 2008
Posts: 13
Location: bangalore

PostPosted: Tue Feb 23, 2010 11:13 am    Post subject: To display packed decimal with sign
Reply with quote

Hi all,
There is a requirement of converting a packed decimal to readable format to write to an output file.
The input variable is in format as follows.

01 ws-inp-amt pic s9(12)v9(2) comp -3.

So the corresponding output variable declaration is as follows

01 ws-out-amt pic +z(12)9.99.

If the input value is +1234.99, the output coming now is
Code:
"+              1234.99".


There is a space appearing between the sign and the value.But the desired result is that the sign should come immediately
before the value +1234.99.

How to remove the spaces appearing between the sign and the value
without modifying the variable length?
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: Tue Feb 23, 2010 11:19 am    Post subject:
Reply with quote

Hello,

The documentation is your friend. . .

There s a link to "IBM Manuals" at the top of the page. In the Enterprise COBOL Language Reference is:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/igy3lr50/5.3.12.8.1
Back to top
View user's profile Send private message
Neena John

New User


Joined: 20 Nov 2008
Posts: 13
Location: bangalore

PostPosted: Tue Feb 23, 2010 11:36 am    Post subject:
Reply with quote

Thanks a lot. icon_biggrin.gif

I used ++(12)9.99 instead of +z(12)9.99.Now the sign is coming immediately after the value.
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: Tue Feb 23, 2010 8:41 pm    Post subject: Reply to: To display packed decimal with sign
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
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 Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
This topic is locked: you cannot edit posts or make replies. Get and display content of an address... lind sh CICS 1 Mon Aug 08, 2016 9:18 am


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