Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Code numeric format to display both '+' and '-' signs ?

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

New User


Joined: 27 Apr 2005
Posts: 15
Location: United States

PostPosted: Wed Nov 21, 2018 10:20 pm    Post subject: Code numeric format to display both '+' and '-' signs ?
Reply with quote

Hi All,
I was wondering if you could tell me if it is possible to define a numeric field that will display a number with Both the '+' and '-' sign on the left side of the number.

It is easy to define to get the minus sign with s9999 and -9999, but I want to force the positive sign to display also without having to 'move +' it into a position.
Would like to display +1234 as well as -1234.

Thank you for your advise!
Back to top
View user's profile Send private message

RahulG31

Active User


Joined: 20 Dec 2014
Posts: 447
Location: USA

PostPosted: Wed Nov 21, 2018 10:54 pm    Post subject: Reply to: Code numeric format to display both '+' and '-' signs ?
Reply with quote

Use SIGN LEADING SEPARATE

.
Back to top
View user's profile Send private message
Time2Live

New User


Joined: 27 Apr 2005
Posts: 15
Location: United States

PostPosted: Thu Nov 22, 2018 3:40 am    Post subject:
Reply with quote

Thank you RahulG31. I shall look that up. icon_cool.gif
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 977
Location: Richmond, Virginia

PostPosted: Thu Nov 22, 2018 6:35 am    Post subject:
Reply with quote

It's been a long time, but I think SIGN LEADING SEPARATE refers to internal representation of zoned decimal, not an edit format.

Don't you just use the edit format with a "+" at the left end rather than a "-" (the latter forcing a "-" for negative and blank o.w.)?
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 388
Location: Maryland

PostPosted: Thu Nov 22, 2018 8:13 pm    Post subject:
Reply with quote

Phrzby Phil wrote:
It's been a long time, but I think SIGN LEADING SEPARATE refers to internal representation of zoned decimal, not an edit format.

Don't you just use the edit format with a "+" at the left end rather than a "-" (the latter forcing a "-" for negative and blank o.w.)?

PIC +...... forces any sign, both '+' and '-' to be explicitly displayed. This is the simplest way to achieve this goal.
Back to top
View user's profile Send private message
Chetan Kumar

New User


Joined: 03 Dec 2012
Posts: 42
Location: India

PostPosted: Thu Nov 22, 2018 11:39 pm    Post subject:
Reply with quote

You can simple use ZZZZZZ.99- edit picture clause. This will display + if positive or - if negative.
Back to top
View user's profile Send private message
Time2Live

New User


Joined: 27 Apr 2005
Posts: 15
Location: United States

PostPosted: Fri Nov 23, 2018 12:58 am    Post subject: Reply to: Code numeric format to display both '+' and '-' signs ?
Reply with quote

Thank you Very Much people! I learned a lot from you all. icon_biggrin.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2123
Location: UK

PostPosted: Fri Nov 23, 2018 3:26 am    Post subject: Reply to: Code numeric format to display both '+' and '-' signs ?
Reply with quote

All this, plus floating signs, are in the manual under the PICTURE topic. It includes examples. Why did you not look in the manual in the first place? A quick look-up in the contents and index would have got you the information.
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 calling java code(on mainframe from c... elixir1986 COBOL Programming 1 Fri Nov 30, 2018 1:57 am
No new posts Will this code extract 1 byte from fi... pkmurali CLIST & REXX 8 Sat Nov 10, 2018 11:13 pm
No new posts SQL CODE 206 Ashishpanpaliya DB2 12 Wed Oct 10, 2018 9:20 pm
No new posts Invoke WebService failing with respon... Ashishpanpaliya CICS 3 Thu Aug 09, 2018 3:14 pm
This topic is locked: you cannot edit posts or make replies. IO-PCB status code AL srinianusuya IMS DB/DC 1 Mon Aug 06, 2018 10:26 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us