Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
deb_parthas

New User

Joined: 24 Nov 2005
Posts: 18

 Posted: Fri May 12, 2006 7:48 am    Post subject: Equivalent Numeric Sign Values for B, {, K and J Hi Frnds, I need a help.. I have a cobol declaration as S9(12)V99 and the values for this field are being displayed as 0000000000000B, 0000000000000{, 0000000000000K, 0000000000015J. Could you pls let me know what these values are in numeric. Is there a table available for these converions? Also, if I need to negate these values from another S9(12)V99 value, how do I do that? Thanks for any input, Partha

steve

New User

Joined: 24 Mar 2005
Posts: 16
Location: Long Island

 Posted: Fri May 12, 2006 12:19 pm    Post subject: What you are getting is a Junk.. initialize them with VALUE 0 in the delcaration section. You should get proper output..
hemanta

New User

Joined: 09 May 2006
Posts: 5

 Posted: Fri May 12, 2006 12:42 pm    Post subject: Hi partha the corresponding numeric values are +02 +00 -01 +150
Anuj Dhawan

Senior Member

Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

 Posted: Fri May 12, 2006 6:37 pm    Post subject: Hi hemanta, How do You find the numeric values used by deb_parthas in his query ?
shrivatsa
Warnings : 1

Active User

Joined: 17 Mar 2006
Posts: 171
Location: Bangalore

 Posted: Fri May 12, 2006 6:57 pm    Post subject: Do HEX ON You will get the Values of that Correct me if I am wrong
hemanta

New User

Joined: 09 May 2006
Posts: 5

 Posted: Mon May 15, 2006 9:33 am    Post subject: Hi Anuj, in Mainframe the values are sometimes stored like this If the right most digit is any letter between A to I then the corresponding number is +1 to + 9 If the right most digit is any letter between J to R then the corresponding number is -1 to - 9 So if the number is 15J it is acutually -151 . sorry i have told it as 150 +0 is will be represented as { -0 will be represented as } so 15} is -150 and 15{ is +150 Think now u r clear
Marso

REXX Moderator

Joined: 13 Mar 2006
Posts: 1275
Location: Israel

Posted: Mon May 15, 2006 6:03 pm    Post subject:

Hello,
hemanta gave the closest good answer:
 Quote: If the right most digit is any letter between A to I then the corresponding number is +1 to + 9 If the right most digit is any letter between J to R then the corresponding number is -1 to - 9 +0 is will be represented as { -0 will be represented as }

But he didn't take into account that the field is defined with V99, so the values are:
000B -> +0.02
000{ -> +0.00
000K -> -0.02
015J -> -1.51

If you want to correctly DISPLAY the values, use an interim field, for example:

 Code: 01  DISPL-NUM     PIC +(11)9.99. MOVE YOUR-FIELD TO DISPL-NUM DISPLAY DISPL-NUM ' WILL SHOW OK'
Anuj Dhawan

Senior Member

Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

Posted: Fri Jun 08, 2007 9:23 pm    Post subject:

 hemanta wrote: so 15} is -150 and 15{ is +150

Hi hemanta,
Can you please direct me to some link or provide me some documnet on this. That'll help me rather better.
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

 Posted: Fri Jun 08, 2007 9:41 pm    Post subject: Hello, What you are seeing is the proper values for signed zoned-decimal numbers. With a zoned-decimal (PIC S9(n)), the sign is placed in the high-order nibble (1/2 byte) of the low-order byte. There is no table needed - if you display those values from a program, the expected values will be presented. If you want to "see" the actual values, HEX ON works well. You will notice that signed positive values from zero to nine are from x'C0-C9' and negative values are from x'D0-D9'. If you see values from x'F0-F9' they are unsigned values that are assumed positive if used in a calculation or a compare. Steve - why would you think they were junk? That is completely inaccurate. . .
Anuj Dhawan

Senior Member

Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

 Posted: Mon Jun 11, 2007 9:30 pm    Post subject: Thanks for the explanation Dick. I thought about an exercise-type documentation. I know about HEX-ON/OFF, values represented by them & played with them a bit..but sometimes they puzzle me, so asked.
dick scherrer

Site Director

Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

 Posted: Mon Jun 11, 2007 9:40 pm    Post subject: You're welcome That's why we're here. . .
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics LOW VALUES as a KEY juares castro DB2 10 Sat Apr 07, 2018 1:06 am Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am Query to compare 2 values of 1 column... Poha Eater DB2 13 Fri Mar 09, 2018 10:45 am attchmvs from rexx subroutine that re... harisukumaran CLIST & REXX 1 Fri Jan 19, 2018 5:29 am Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us