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 84 of 159    Print  
How data names with comp1 usage is stored in memory ? What is difference between comp1 comp2 , comp3 and binary ?

  
Total Answers and Comments: 4 Last Update: February 07, 2007     Asked by: vanitha 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 29, 2006 17:48:58   #1  
sangramkc        

RE: How data names with comp1 usage is stored in memor...

COMP-1 is usually a single precision floating point value , stored in 4 bytes.

COMP-2 is usually a double precision floating point value , stored in 8 bytes

COMP-3 stores data in BCD format Binary Coded Decimal format with sign after least significat digit

Thanks,

Sangram

Sai ram


 
Is this answer useful? Yes | No
December 07, 2006 05:41:13   #2  
karthi        

RE: How data names with comp1 usage is stored in memor...

hi,

Comp - 1: Its single pricison floting point value. This is occupies for 4 bytes.

Comp - 2: Its Double pricison floting point value. This is occupies for 8 bytes.

Comp - 3: Its Packed Decimal value. Each digit contains half byte + half sign  byte. but the sign stored in last nibble.  formula of comp - 3: n/2 + 0.5


 
Is this answer useful? Yes | No
December 17, 2006 10:03:35   #3  
Balasubramanian G Member Since: December 2006   Contribution: 2    

RE: How data names with comp1 usage is stored in memor...
USAGE COMP-1 : Data is stored as single precision floating point in 4 bytes.Difference between COMP-1, COMP-2, COMP-3 and COMP :COMP-1 data is stored as single precision floating point using 4 bytes of memory.COMP-2 data is stored as double-precision floating point using 8 bytes of memory.COMP-3 data is stored in Packed Decimal format. The number of bytes occupied depends on the size of the field specified in the PICTURE clause.The formula for finding the number of bytes needed to store the data is INTEGER((n/2) + 1) where 'n' is the size of the field. (Note: If SIGN SEPARATE clause is specified, one more byte is needed to store the sign).COMP : data is stored in binary format.For USAGE COMP-1 or USAGE COMP-2 picture clause is not to be given whereas for COMP and COMP-3 picture clause is to be given.
 
Is this answer useful? Yes | No
February 07, 2007 03:44:58   #4  
ramana        

RE: How data names with comp1 usage is stored in memor...
Hello Guys,



Comp-1: Storage is in hexadecimal and size is full word(4-bytes)

Comp-2: Storage is in hexadecimal and size is duobleword.

Comp-3: Storage is in packed hexadecimal and size is (n/2)+1.

 
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