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

How data will be stored in COMP3?


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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
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: 1208
Location: Bangalore,India

PostPosted: Thu Sep 28, 2006 11:06 am
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
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: 1208
Location: Bangalore,India

PostPosted: Fri Sep 29, 2006 9:21 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
Search our Forums:

Back to Top