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

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

Answer: 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.'


December 12, 2005 03:36:46 #1
 mahinder   Member Since: Visitor    Total Comments: N/A 

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

     

 

Back To Question