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

To display packed decimal with sign


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Tue Feb 23, 2010 11:19 am
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:
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
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

Moderator Emeritus


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

PostPosted: Tue Feb 23, 2010 8:41 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Select a DB2 value in a specific deci... DB2 4
Search our Forums:

Back to Top