Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


01 ws-p pic 9(2).
01 ws-q pic 9(2) value 01.
01 ws-r pic 9(2) value 99.

p.d.

compute p = q + r
what will be result of p ans(00) but my question is that

how i got 10 on the place of 00.
(truncation will ocuure on right side not left).

please tell me ?


Answers were Sorted based on User's Feedback



01 ws-p pic 9(2). 01 ws-q pic 9(2) value 01. 01 ws-r pic 9(2) value 99. p.d. compute p = q +..

Answer / minhaj

01 p pic 9(02) value zero.
01 q pic 9(02) value 99.
01 r pic 9(02) value 1.

p = q+r.
actual p value = 100. but p value is numeric so it writes
from right to left tuncations will be taken left side.
so p value = 00 if u want p = 10 then use justifications

Is This Answer Correct ?    8 Yes 1 No

01 ws-p pic 9(2). 01 ws-q pic 9(2) value 01. 01 ws-r pic 9(2) value 99. p.d. compute p = q +..

Answer / reddy kanupuru

u will get 00 only.

Because any numeric move will start from decimal pont

for exp : as per the given ques

compute p = q+r =100

here the decimal point is placed at the right side .

100.

so if u move that to 99 , means before point two digits
(00) will be moved .

another exp:

q = 99v99

01 r pic 99v99 value 100.345
move r to q

the value is 00v34

Is This Answer Correct ?    6 Yes 0 No

01 ws-p pic 9(2). 01 ws-q pic 9(2) value 01. 01 ws-r pic 9(2) value 99. p.d. compute p = q +..

Answer / sam

01 p pic 9(02) value zero.
01 p1 pic 9(03) value zero
01 q pic 9(02) value 99.
01 r pic 9(02) value 1.
01 s pic x(02) value spaces.

p = q+r.
actual p value = 100. but p value is numeric so it writes
from right to left tuncations will be taken left side.
so p value = 00 if u want p = 10
but we cann't use justifications
since justification claue works on alphanumeric field.
so compute p1 = q+r.
move p1 to s . ( here s will contain value 10)
now move s to p.then p will be 10.

Is This Answer Correct ?    2 Yes 1 No

01 ws-p pic 9(2). 01 ws-q pic 9(2) value 01. 01 ws-r pic 9(2) value 99. p.d. compute p = q +..

Answer / minhaj

p = q+r actuall result is p = 10 but u want p = 10 so we
right the code as p = q+r justified right

Is This Answer Correct ?    1 Yes 1 No

01 ws-p pic 9(2). 01 ws-q pic 9(2) value 01. 01 ws-r pic 9(2) value 99. p.d. compute p = q +..

Answer / nataraj

q value is 01
r value is 99

after compute p value is 100

normally value is printed left to right so u get 10
place of p

Is This Answer Correct ?    0 Yes 5 No

01 ws-p pic 9(2). 01 ws-q pic 9(2) value 01. 01 ws-r pic 9(2) value 99. p.d. compute p = q +..

Answer / jayaprabhu

simple always remember that for numeric it's Left
Justification ie TAKE FROM LEFT PLACE FIRST IN LEFT

SO P=100 but as per you it shd be 00 but it will be 10

1 IS FROM LEFT SIDE MOST THEN 00 so if we move as per above
then
p is pic9(02)

so 10 first 1 is moved from left to left then 0 is moved
but since pic 9(02) only to digits get moved

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More COBOL Interview Questions

I have a field with data type X(10). I want to perform arithmetic operation on this field? I tried doing it by moving the value into a numeric field. but it didn't work out. I am getting a S0C7 abend. Pls let me know if there is any way of getting this done?

1 Answers  


What are all the divisions of a COBOL program?

0 Answers  


What are various search techniques in cobol? Explain.

0 Answers  


perform I from 0 by 1 until I=5?How maney times it will executes

8 Answers  


We have 3 programms A,B,C.In the middle of the program A the controls goes to program B and in the middle of the program B control wants to go program C,after completion of program C again control comes to program B and again after completion of program B control comes to program A.How the process will takes and what are the controls we use for that process.If it is possible anybody of you explain with example?

5 Answers   IBM,


What are the ways you can generate a copybook?

2 Answers  


can we redefine 77 level item is it possible

4 Answers   HCL,


what is qualification on occurs clause?

2 Answers  


can we use COPY statement in w-s section? how?

3 Answers  


how you read control card into array?

3 Answers   HCL,


What is the difference between comp and comp-3 usage? Explain other COBOL usage?s.

3 Answers   IBM, Xansa,


for an INITIALIZE and what keyword allows for an override of the default.

2 Answers  


Categories