Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
What is the difference between COMP-3 and COMP-4 variables

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

New User


Joined: 19 Apr 2005
Posts: 26

PostPosted: Wed Feb 01, 2006 8:58 am    Post subject: What is the difference between COMP-3 and COMP-4 variables
Reply with quote

Hi all,

1. Can I know where and how can we see the values and format
of all the COMP variables in COBOL.

2. What is the difference between COMP-3 and COMP-4 variables.



Thanks in advance,
Sripriya.
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Feb 01, 2006 10:30 am    Post subject:
Reply with quote

Regarding you second question, you can find the answer in the fine manual.

O.
Back to top
View user's profile Send private message
neerajpeddu

New User


Joined: 03 Feb 2006
Posts: 25
Location: Calgary, AB

PostPosted: Fri Feb 03, 2006 3:48 am    Post subject:
Reply with quote

Comp-3 is packed decimal while Comp-4 is the same as Comp and it holds binary value.

Let us say Pic S9(8) Comp-3, this will occupy 5 bytes which is 8/2+1. This one can hold a max of 8 digit number

Pic S9(8) Comp & Comp-4 will occupy 4 bytes and is called a full word binary. 9(4) is called half word binary.

Look at the following links for more info
http://en.wikipedia.org/wiki/Integer_(computer_science)
http://www.cs.umd.edu/class/spring2003/cmsc311/Notes/Data/bitBytes.html
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 Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 0 Wed Jan 25, 2017 8:21 pm
No new posts Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us