Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm
No new posts display the sign only if the value is... useit DFSORT/ICETOOL 3 Wed Oct 04, 2017 5:53 pm
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts Hardcoded negative sign value in output scdinesh SYNCSORT 8 Fri Sep 08, 2017 5:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us