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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am


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