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

S9(9) value is not displaying in report properly.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Jun 16, 2011 6:28 pm
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
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
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jun 17, 2011 12:45 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts IBM OnDemand Folders displaying to al... IBM Tools 6
No new posts Need help on formatting a report DFSORT/ICETOOL 14
No new posts Creating Report using SORT DFSORT/ICETOOL 7
No new posts Ca7 long running jobs report All Other Mainframe Topics 1
No new posts Report of batch jobs JCL & VSAM 1
Search our Forums:

Back to Top