GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 12 of 158    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

No best answer available. Please pick the good answer available or submit your answer.
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 | No
September 02, 2008 16:17:50   #4  
atherprvz Member Since: September 2008   Contribution: 0    

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  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape