Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How Low Values will be stored in COMP-3 Variable?
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: 685
Location: Earth

PostPosted: Fri Nov 23, 2007 12:48 pm    Post subject:
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: 1439
Location: Bangalore,India

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

Abhijit,

Prev post might help you. Follow the link -

http://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    Post subject: Reply to: How Low Values will be stored in COMP-3 Variable?
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: 685
Location: Earth

PostPosted: Fri Nov 23, 2007 1:10 pm    Post subject:
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: 685
Location: Earth

PostPosted: Fri Nov 23, 2007 1:17 pm    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Fri Nov 23, 2007 1:57 pm    Post subject:
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    Post subject:
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    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 SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us