View previous topic :: View next topic
|
Author |
Message |
jaimf
New User
Joined: 07 Dec 2009 Posts: 5 Location: Bangalore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
jaimf
New User
Joined: 07 Dec 2009 Posts: 5 Location: Bangalore
|
|
|
|
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 |
|
|
jaimf
New User
Joined: 07 Dec 2009 Posts: 5 Location: Bangalore
|
|
|
|
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 |
|
|
jaimf
New User
Joined: 07 Dec 2009 Posts: 5 Location: Bangalore
|
|
|
|
output result:
-bbbbbbbbbbbb$3.00
where b=> Spaces |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Dham
New User
Joined: 21 Nov 2009 Posts: 1 Location: Hyderabad
|
|
|
|
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 |
|
|
|