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
 
S9(9) value is not displaying in report properly.

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

New User


Joined: 31 Aug 2009
Posts: 73
Location: Mumbai

PostPosted: Thu Jun 16, 2011 6:14 pm    Post subject: S9(9) value is not displaying in report properly.
Reply with quote

Hi All,

I am creating a report thru cobol program. I am writing a quantity field in each detail record.

After writing few records i am calculating its NET value and Display in report.
My WS-NET is declared as PIC S9(9).
The Issue is whatever value this variable is showing in report is not showing in +/- value. Its showing with EBCDIC code.
For Ex. If NET value is +000000960, then it is displaying it as 00000096{.
If it is -000001920, then it is showing as NET: 00000192}.

Can any one pls suggest, how to display proper value.
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


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

PostPosted: Thu Jun 16, 2011 6:28 pm    Post subject:
Reply with quote

There is a link to manuals at the top of THIS page. Click on it, find the COBOL Language Reference manual, and read up on numeric edited variables. Use the flashlight to search for numeric edit for example.
Back to top
View user's profile Send private message
Stefan

Active User


Joined: 12 Jan 2006
Posts: 110
Location: Germany

PostPosted: Thu Jun 16, 2011 6:28 pm    Post subject:
Reply with quote

Used instead PIC +9(9)
Back to top
View user's profile Send private message
Dsingh29

Active User


Joined: 16 Dec 2008
Posts: 132
Location: IBM

PostPosted: Fri Jun 17, 2011 11:48 am    Post subject: Reply to: S9(9) value is not displaying in report properly.
Reply with quote

The PICTURE character for a sign in a numeric variable that will be used for a DISPLAY is the minus sign (-).

The following variable holds the values -999.99 through 999.99 for display purposes:
01 DISPLAY-VALUE PIC -999.99.

The display sign (-) displays only when the value is negative. If DISPLAY-VALUE contains -46.17, it displays as the following:
-046.17

However, the number 55.03 displays as follows:
055.03
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Jun 17, 2011 11:56 am    Post subject:
Reply with quote

Stefan wrote:
Used instead PIC +9(9)


Will the sign not get lost?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Jun 17, 2011 12:45 pm    Post subject:
Reply with quote

gylbharat wrote:
Stefan wrote:
Used instead PIC +9(9)


Will the sign not get lost?


I'm not sure what you mean. Try it and see. If you feel it does get "lost", let us know.

I'm curious to see so much use of "leading" signs in reports around here. We always used a "trailing" sign, you can tell without having to eye-scan the whole figure whether it is -ve or not.

Other possibilities are to use the CR/DB editing if that is what the user wants, or two columns, one for the "plus" and one for the "minus" - don't get confused when talking to accountants, listen to exactly what they want. With CR/DB a -ve is CR, because that is how they do their figures (never come across different).

Also surprised not to see ","s to make large numbers easier to read. Decimal places, but can depend on the currency, though any sort of fraction in a calculation that is then not displayed is asking for trouble.

In short. Familiarise yourself with editing possibilities. Find out what the user wants to see. Produce what the user wants to see, if possible/reasonable, or go back to user to get it changed.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Fri Jun 17, 2011 3:53 pm    Post subject:
Reply with quote

Thanks Bill,

I ran the program by specifying +9(9). It ran correcly and displayed the signs also. Thanks for 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 Reg:Displaying the particular month o... bhavana yalavarthi All Other Mainframe Topics 4 Sat Jul 08, 2017 8:13 pm
No new posts Report cost in CA-dispatch Nileshkul CA Products 3 Wed Jun 07, 2017 10:32 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 7 Mon Mar 27, 2017 3:59 pm
No new posts Easytrieve report shalem CA Products 4 Sun Feb 26, 2017 9:08 am
No new posts Detailed Transaction History report f... Kyle Carroll CICS 5 Tue Oct 18, 2016 12:42 am

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