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
This topic is locked: you cannot edit posts or make replies. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts Using indexed variables in EZPLUS SRIDEVI TANTRY CA Products 1 Thu Feb 01, 2018 12:15 pm
No new posts COMP Variables Mismatch gayu7 COBOL Programming 5 Wed Dec 20, 2017 5:06 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts ISMF Difference between volume count ... upendrasri IBM Tools 2 Tue Dec 05, 2017 12:40 pm

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