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 sign with $ symbol

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

New User


Joined: 07 Dec 2009
Posts: 5
Location: Bangalore

PostPosted: Tue Jan 19, 2010 6:49 pm    Post subject: To display sign with $ symbol
Reply with quote

Hi! Please help me out to display the Sign symbol along with $ currency sign.[/b]

I want the value to be displayed as shown below ,

-$9,999,999,999.99

Please provide me the picture clause for the above.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Jan 19, 2010 6:56 pm    Post subject: Re: To display sign with $ symbol
Reply with quote

jaimf wrote:
Please provide me the picture clause for the above.
[/b]

What have you researched for yourself
What were the results of your research

This is a HELP forum, not a Do my job for me forum.
Please show what you have done and then you are more likely to get some help.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Tue Jan 19, 2010 7:11 pm    Post subject:
Reply with quote

this has been discussed before; can't have two floating characters,
as the earlier thread discussed,
and as the picture clause discussion in the manual explains

or is this another one of those 'i know it is against the rules, but I want to do it anyway'

answer is that you need to use the currency symbol as the floating character
and then find the space before the currency symbol and move the negative sign or not (if it is positive).

why do people have to have leading signs and not trailing?
Back to top
View user's profile Send private message
jaimf

New User


Joined: 07 Dec 2009
Posts: 5
Location: Bangalore

PostPosted: Tue Jan 19, 2010 7:18 pm    Post subject:
Reply with quote

Exercise 1:
05 WS-RPT-SS-PREM PIC -$,$$$,$$$,$$$.99.

Input Value:
3.00
output result:
- $3.00

But i want the value to be displayed as mentioned below,
-$3.00

I also used the Z as parameter instead of $ then also iam not getting the output as i expected as shown above.

Please help me out by providing some suggestion to get the expected output.
Back to top
View user's profile Send private message
jaimf

New User


Joined: 07 Dec 2009
Posts: 5
Location: Bangalore

PostPosted: Tue Jan 19, 2010 7:21 pm    Post subject:
Reply with quote

Sorry some corrections in the output result of this exercise.
Exercise 1:
05 WS-RPT-SS-PREM PIC -$,$$$,$$$,$$$.99.

Input Value:
3.00
output result:
- $3.00

But i want the value to be displayed as mentioned below,
-$3.00

I also used the Z as parameter instead of $ then also iam not getting the output as i expected as shown above.

Please help me out by providing some suggestion to get the expected output.
Back to top
View user's profile Send private message
jaimf

New User


Joined: 07 Dec 2009
Posts: 5
Location: Bangalore

PostPosted: Tue Jan 19, 2010 7:25 pm    Post subject:
Reply with quote

output result:
-bbbbbbbbbbbb$3.00

where b=> Spaces
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Tue Jan 19, 2010 8:10 pm    Post subject:
Reply with quote

As you have already been told, you cannot combine more than one floating insertion symbol in a PICTURE clause. You can achieve you goal by using reference modification, or you can accept what COBOL gives you using the PIC clause you have used. These are your only two choices.
Back to top
View user's profile Send private message
Dham

New User


Joined: 21 Nov 2009
Posts: 1
Location: Hyderabad

PostPosted: Sat Jan 23, 2010 12:48 pm    Post subject:
Reply with quote

Symbols that can be used for floating insertion editing are
Currency sign + -

These symbols should be mutually exclusive.

So then how is code executing. Shouldn't there be an error when it is compiled with a Picture clause of "-$,$$$,$$$,$$$.99." Please clarify

COBOL Language Reference manual says.... :
Quote:
Floating insertion editing
This type of editing is valid only for numeric-edited items.
The following symbols are used:
cs + −
Within one PICTURE character-string, these symbols are mutually exclusive as
floating insertion characters.


PS: I dont have mainframe access now so couldnt test this.
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 Display ZEDLMSG without Pressing F1 &... anandgbe CLIST & REXX 8 Thu Dec 15, 2016 4:20 pm
No new posts How to display value of an exit param... lind sh CICS 2 Sun Oct 09, 2016 12:28 pm


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