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

How Low Values will be stored in COMP-3 Variable?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Fri Nov 23, 2007 11:46 am
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Nov 23, 2007 12:48 pm
Reply with quote

Who told you that it is possible to store low values in PACKED DECIMAL variable? Did you try coding it?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Nov 23, 2007 12:51 pm
Reply with quote

Abhijit,

Prev post might help you. Follow the link -

ibmmainframes.com/about10196.html
Back to top
View user's profile Send private message
itjagadesh

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Fri Nov 23, 2007 1:08 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Nov 23, 2007 1:10 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Fri Nov 23, 2007 1:17 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Nov 23, 2007 1:57 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Nov 26, 2007 7:48 pm
Reply with quote

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
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Variable Output file name DFSORT/ICETOOL 8
Search our Forums:

Back to Top