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 42 of 158    Print  
How may do the following definitions occupy?

(a) s(3)v99 comp-3
(b) s(9)v99 comp

  
Total Answers and Comments: 7 Last Update: August 22, 2008     Asked by: Bharath 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 23, 2006 03:29:40   #1  
janaki        

RE: How may do the following definitions occupy?...
comp usage doesnot allow decimal values
 
Is this answer useful? Yes | No
March 18, 2006 19:58:11   #2  
Culver_lake Member Since: March 2006   Contribution: 46    

RE: How may do the following definitions occupy?...

Poor syntax.  S9(3)V99 is correct and occupies 3 bytes. Count the number of 9's add 1 and divide by 2 rounding up if necessary. ex. 

S9(7)v99.  there are 9 nines.  (9+1)/2 = 5 bytes.

S9(6)V99.  there are 8 nines  (8+1)/2 = 4.5 = 5 bytes.

binary data (COMP) has no fractions, integers only.


 
Is this answer useful? Yes | No
April 05, 2006 00:17:34   #3  
Anuja Tiwari        

RE: How may do the following definitions occupy?...

COMP fields are stored as binary.

9(1) to 9(4) are stored as 2 Binery.
9(5) to 9(9) are stored as 4 Binery.
9(10) to 9(18) are stored as 8 Binery.

so if your question is for S9(1)V9(2) comp, it will be in Binery form and occupy 2 bytes.

 


 
Is this answer useful? Yes | No
April 26, 2006 05:44:30   #4  
NarayaN        

RE: How may do the following definitions occupy?...

Can we generalize as follows,

S9(x)V9(y) will occupy (x+y+1)/2 bytes (Rounded to the next higher integer).

Is this for a USING COMP or COMP 3? How is the number of bytes calculated for the other?

Thanks!!

NarayaN


 
Is this answer useful? Yes | No
May 29, 2006 05:37:57   #5  
kapil vharande        

RE: How may do the following definitions occupy?...
For comp it will take bytes (n/2+1)For comp-3 it will take bytes as(n/2+1)+.5 & n is numeric charactor define in data division.
 
Is this answer useful? Yes | No
July 20, 2006 05:20:01   #6  
Rajeev Saklani        

RE: How may do the following definitions occupy?...

 Hi,

     ur question for comp and comp-3 storage

    u have mentioned comp and assumed decimal v, for comp it is pure binary value and decimal is not allowed and storage formula is n/2 where n is number of 9's. For comp-3 we have (n/2 +1) where n is the no of 9's in integer and decimal parts. eg s9(3)v99 would occupy 5/2 +1 = 3 bytes.

for decimal we have comp-1 and comp-2 in halp word and fullword format

 correct me if i am not right.

Rajeev saklani

Mainframe s/w engg


 
Is this answer useful? Yes | No
August 22, 2008 10:04:37   #7  
sunilrai15 Member Since: August 2008   Contribution: 1    

RE: How may do the following definitions occupy?(a) s(3)v99 comp-3(b) s(9)v99 comp
For s9(3)v99 comp-3.
system will take (5+1)/2 = 3bytes..

For S9(1)v99 comp.
Here system will take 2 bytes.

because we know that 1-4 range store 2bytes
5-9 store 4 bytes
10-18 store 8 bytes

 
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