GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 12 of 162    Print  
What is the difference between comp and comp-3 usage? Explain other COBOL usages?
Comp is a binary usage, while comp-3 indicates packed decimal. The other common usages are binary and display. Display is the default. 3/28/00 Dave Herrmann: 'I was reading your FAQ on Cobol, as an fyi Comp is defined as the fastest/preferred numeric data type for the machine it runs on. IBM Mainframes are typically binary and AS400's are packed.'


  
Total Answers and Comments: 4 Last Update: September 02, 2008   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: poojaDeep
 
COMP Comp is used for Binary Representation it allows only
S and 9 ... s9(01) to s9(04) it takes 2 bytes memory
s9(05) to s9(09) it takes 4 bytes memory
s9(10) to s9(18) it takes 8 bytes memory
 
COMP-3 :- Comp-3 is used for Packed Decimal values it allows S,9 ,V mostly it is useful for Decimal Caluculation Values.
 
it takes (n/2)+1 Bytes Memory : for N= Even values
(n+1)/2 : For n=Odd


Above answer was rated as good by the following members:
kmdeepu
December 12, 2005 03:36:46   #1  
mahinder        

RE: What is the difference between comp and comp-3 usa...

hai

COMP

Comp is used for Binary Representation

it allows only S and 9 ...

s9(01) to s9(04) it takes 2 bytes memory

s9(05) to s9(09) it takes 4 bytes memory

s9(10) to s9(18) it takes 8 bytes memory

COMP-3

Comp-3 is used for Packed Decimal values

it allows S 9 V

mostly it is useful for Decimal Caluculation Values

it takes (n/2)+1 Bytes Memory


 
Is this answer useful? Yes | No
August 31, 2007 09:23:25   #2  
venkatesh        

RE: What is the difference between comp and comp-3 usa...
Comp Comp1 Comp2 are used when you going to use SYNC (When you want the storage should start only at the boundaries). In other cases it depends....Venkat
 
Is this answer useful? Yes | No
April 16, 2008 08:31:46   #3  
poojaDeep Member Since: April 2008   Contribution: 4    

RE: What is the difference between comp and comp-3 usage? Explain other COBOL usages?
COMP Comp is used for Binary Representation it allows only
S and 9 ... s9(01) to s9(04) it takes 2 bytes memory
s9(05) to s9(09) it takes 4 bytes memory
s9(10) to s9(18) it takes 8 bytes memory

COMP-3 :- Comp-3 is used for Packed Decimal values it allows S 9 V mostly it is useful for Decimal Caluculation Values.

it takes (n/2)+1 Bytes Memory : for N Even values
(n+1)/2 : For n Odd

 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
September 02, 2008 16:17:50   #4  
atherprvz Member Since: September 2008   Contribution: 1    

RE: What is the difference between comp and comp-3 usage? Explain other COBOL usages?

Binary representation of data item are called 'comp' while comp-3 is the packed decimal.
comp-1 & comp-2 are another usage.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape