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

To display sign with $ symbol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Tue Jan 19, 2010 6:56 pm
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: 6966
Location: porcelain throne

PostPosted: Tue Jan 19, 2010 7:11 pm
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
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
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
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: 8697
Location: Dubuque, Iowa, USA

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

 


Similar Topics
Topic Forum Replies
No new posts How to display the leading zeros of a... DB2 7
No new posts Using PARM=('JPn"&SYMBOL&quo... DFSORT/ICETOOL 2
No new posts SDSF display Max-RC in different colors TSO/ISPF 4
No new posts Converting a file from PD to display ... SYNCSORT 4
No new posts Unable to display comp variable COBOL Programming 4
Search our Forums:

Back to Top