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 How can I convert charactor to fixed ... liying DFSORT/ICETOOL 7 Tue May 22, 2018 3:35 pm
No new posts How to display offset thru cobol prog... tvinodkumar7 CICS 2 Sun Apr 22, 2018 8:42 pm
No new posts how to display APL characters? Pedro TSO/ISPF 7 Wed Mar 14, 2018 5:07 am
No new posts How to group and sum the decimal value sakrat DFSORT/ICETOOL 2 Tue Mar 06, 2018 9:13 pm
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm

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