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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


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