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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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