GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  TCS  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 2 of 44    Print  
consider two data items
77 W-A PIC 9(3)V99 VALUE 23.75
77 W-B PIC ZZ9V99 VALUE 123.45
after the statement
MOVE W-A TO W-B
what will be W-B value?
a.123.75
b.b23.75 (where b indicates space)
c.023.75
d.invalid move

  
Total Answers and Comments: 6 Last Update: September 11, 2009   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
September 28, 2005 00:05:19   #1  
Praveen Kumar Member Since: September 2005   Contribution: 6    

RE: consider two data items 77 W-A PIC 9(3)V99 VA...

Ans is b ie.. b23.75 (where b indicates space).

Reason is W-B is defined with editing characters Z which suppreses zeros with spaces.


 
Is this answer useful? Yes | No
April 26, 2006 02:45:29   #2  
shashi pai        

RE: consider two data items 77 W-A PIC 9(3)V99 VA...
I dont think so. Correct answer out of 4 options should be invalid move. This code will fail in compilation itself as the value clause is not compatible with the type. If you still have doubts try it out.
 
Is this answer useful? Yes | No
August 24, 2007 09:32:43   #3  
soumya        

RE: consider two data items 77 W-A PIC 9(3)V99 VA...
invalid move.it will not take the values
 
Is this answer useful? Yes | No
February 04, 2008 16:06:44   #4  
roopali3 Member Since: February 2008   Contribution: 5    

RE: consider two data items 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VALUE 123.45 after the statement MOVE W-A TO W-B what will be W-B value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move

I tried this out using microfocus cobol and got that the value of W-B after move is b23.75 where b indicates space. Hence the ans is b.


 
Is this answer useful? Yes | No
May 16, 2008 09:29:28   #5  
wattamwar Member Since: May 2008   Contribution: 1    

RE: consider two data items 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VALUE 123.45 after the statement MOVE W-A TO W-B what will be W-B value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move
Answer would be b23.75 (where b indicates space)
 
Is this answer useful? Yes | No
September 08, 2009 10:38:50   #6  
balasu Member Since: September 2009   Contribution: 2    

RE: consider two data items 77 W-A PIC 9(3)V99 VALUE 23.75 77 W-B PIC ZZ9V99 VALUE 123.45 after the statement MOVE W-A TO W-B what will be W-B value? a.123.75 b.b23.75 (where b indicates space) c.023.75 d.invalid move
The answer is b. b23.75

w-A: 9(3)v99 23.75
w-B zz9v99 123.45

output:

Z is replaced with Blank so output be b.

FYI:
refer cobol ref book mk roy page no 76.




 
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