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 data will be stored in COMP3?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Husna

New User


Joined: 02 Jun 2006
Posts: 49

PostPosted: Thu Sep 28, 2006 8:51 am    Post subject: How data will be stored in COMP3?
Reply with quote

Hi all,

How data (-123) will be stored in COMP3. Any of you please let me know the same?
Back to top
View user's profile Send private message

lucky.rohith
Currently Banned

New User


Joined: 06 Aug 2006
Posts: 10

PostPosted: Thu Sep 28, 2006 9:18 am    Post subject:
Reply with quote

Hi Husna,
In comp-3 data wil be stored in HEXA DECIMAL FORMAT.
The sign is stored in the last nibble i.e last 4 bits.
Back to top
View user's profile Send private message
Husna

New User


Joined: 02 Jun 2006
Posts: 49

PostPosted: Thu Sep 28, 2006 10:00 am    Post subject: Re: How data will be stored in COMP3?
Reply with quote

Hi Rohith,

Thanks for the reply. Actually, I would like know how the -123 value will be allocated in HEXA DECIMAL FORMAT? Please let me know clearly?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Thu Sep 28, 2006 11:06 am    Post subject:
Reply with quote

Hi husna,

It will be 6FFF
0123
Back to top
View user's profile Send private message
Husna

New User


Joined: 02 Jun 2006
Posts: 49

PostPosted: Fri Sep 29, 2006 8:45 am    Post subject:
Reply with quote

Hi Guptae,

Could you please let me know clearly?
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Fri Sep 29, 2006 9:21 am    Post subject:
Reply with quote

Hi husna,

It will be '60F1F2F3'

Correction r welcome.-
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Sat Sep 30, 2006 2:08 am    Post subject: Re: How data will be stored in COMP3?
Reply with quote

Husna,

If you comp-3 field is defined as, say PIC S9(3) COMP-3 then the hex value of the field will be x'123D'. If your field were defined as PIC S9(4) COMP-3 than the hex value would be x'00123D'.

lucky.rohith is correct about the sign. In COMP-3 , or packed decimal, a sign of 'C' is positive, 'D' is nigitive, and 'F' is unsigned'.

Dave
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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Data replication from multiple Db2 ta... kishpra DB2 9 Mon Mar 27, 2017 9:58 pm


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