MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

+-$ in the same field without spaces

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Mon Jun 27, 2016 11:16 am    Post subject: +-$ in the same field without spaces Reply with quote

I have a discount field which has sign and $.
This is defined as DISCOUNT PIC +$$$9.9(2)

so this is display as below.


Code:

DISCOUNT
DETAILS
--------
-  $0.95
-  $2.00
+  $0.00
-  $0.95
--------


I don't want space between the sign and $.
How should I define it? thanks for your time.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Mon Jun 27, 2016 11:20 am    Post subject: Reply with quote

I think I will use +$999.9(2), if I could not compress leading zeros.
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Mon Jun 27, 2016 12:12 pm    Post subject: Reply with quote

Use the currency-symbol as the "floating zero-suppress" and put the sign to the right of the output. You can't have two floating editing symbols operating at the same time.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Mon Jun 27, 2016 1:15 pm    Post subject: Reply with quote

Thanks, will use the below.
$$$$9.9(2)-
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Jun 27, 2016 1:45 pm    Post subject: Reply with quote

vak255,

Alternatively you can use an INSPECT to replace the space and adjust the sign.

Code:

DISCOUNT PIC +$$$9.9(2).
INSPECT DISCOUNT REPLACING ALL '+   $' BY '   +$'
                               '-   $' BY '   -$'
                               '+  $'  BY '  +$' 
                               '-  $'  BY '  -$' 
                               '+ $'   BY ' +$'   
                               '- $'   BY ' -$'   

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Tue Jun 28, 2016 12:52 am    Post subject: Reply with quote

FIRST could replace the ALL, and save a bit. Even LEADING, although that would look at at least one extra byte. Can even drop the $. Various ways with INSPECT.

The thing is, anyone who is interested in whether a value is positive or negative is not interested in "bouncing" their eyes around to locate a floating symbol. Two columns, CR/DB, right=most signs. Then either it already stands out (columns) or you can rapidly scan page after page looking for those odd negative values. Try it Smile
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Tue Jun 28, 2016 10:38 am    Post subject: Reply with quote

William Collins wrote:
FIRST could replace the ALL, and save a bit. Even LEADING, although that would look at at least one extra byte. Can even drop the $. Various ways with INSPECT.


William,

I should have used FIRST instead of ALL. I just picked one of my existing examples and just changed the input and output strings.

My Apologies.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Tue Jun 28, 2016 12:39 pm    Post subject: Reply with quote

As William says, most people I've encountered prefer the trailing negative sign as they are more easily spotted.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group