View previous topic :: View next topic
|
Author |
Message |
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
Hi All,
Could anyone explain me how low values will be stored in COMP-3 variable? (IN Hexadecimal format)
Example : variable A 9(7) COMP-3
HEXADECIMAL : F F F 0
0 0 0 F
Is it correct format of storing Low Values in COMP-3 FOR 9(7)?
can any one explain me ? |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Who told you that it is possible to store low values in PACKED DECIMAL variable? Did you try coding it? |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
Back to top |
|
|
itjagadesh
New User
Joined: 05 Dec 2006 Posts: 89 Location: chennai
|
|
|
|
Hi murmohk1,
Do u have any idea about how it is storing?
i want example for storing varaible A 9(7) COMP-3 In hexadecimal?
could anyone reply this? the above mentioned link im not able to follow? |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Ya murli,
That link was good. But you need to read the topic you posted carefully. Do pay attention to jack's post in there-
Quote: |
Every comp-3 field in mainframe IBM COBOL has a sign nibble (4 bits), whether it's positive (C), negative (D) or unsigned (F) regardless of its length. |
Code: |
HEXADECIMAL : F F F 0
0 0 0 F |
I won't call this as low values.
The only way will be-
Code: |
01 GRP.
05 VARIABLE2 PIC 9(7) COMP-3.
MOVE LOW-VALUES TO GRP |
. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Quote: |
i want example for storing varaible A 9(7) COMP-3 In hexadecimal? |
If this is the question then-
Code: |
01 GRP.
05 VARIABLE2 PIC 9(7) COMP-3.
MOVE LOW-VALUES/any value TO GRP
DISPLAY GRP. |
Do hex on in spool to see how it is stored in hexadecimal..
And one more thing..
Quote: |
Do u have any idea about how it is storing? |
Mind your language before you post something like this.. one can easily get offended with such question even if you meant something else.. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Abhijith,
I agree the hex values posted by Jack is not 'low values'. But from the description, you know 'we need to think/believe like that (in short read their minds)'. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Well, to ans your ques - no, it's not a valid format for comp-3. If you want zeros in your field, move zeros there.
If you insist on low-vals, redifine A as A-X PIC x(4). and move low-vals to A-X. But remember that any arithmetic use of the field (A) will abend the pgm. |
|
Back to top |
|
|
|