01 a pic 9(3) value is 123
01 b pic 9(6)
move a to b

wht will be the value ? and

01 a pic x(6) value is abc
01 b pic x(3)
move a to b

wht will be the value ?

Answers were Sorted based on User's Feedback



01 a pic 9(3) value is 123 01 b pic 9(6) move a to b wht will be the value ? and 01 a pic x..

Answer / arthi

1.
000123

2.
abc

Ravi, I guess you didnt mean the '-' as a minus sign in front of 000123, and abc. your answer is not clear enough.

Is This Answer Correct ?    14 Yes 0 No

01 a pic 9(3) value is 123 01 b pic 9(6) move a to b wht will be the value ? and 01 a pic x..

Answer / kiran

Result

000123
abc

no "-" sign will come bcoze we didnt give like this

01 a pic s9(3) value is 123
01 b pic s9(6)
move a to b

wht will be the value ? and

01 a pic x(6) value is abc
01 b pic x(3)
move a to b

Is This Answer Correct ?    3 Yes 0 No

01 a pic 9(3) value is 123 01 b pic 9(6) move a to b wht will be the value ? and 01 a pic x..

Answer / ravi

Answer to first question is -000123
and answer to second question is -abc

Is This Answer Correct ?    6 Yes 4 No

01 a pic 9(3) value is 123 01 b pic 9(6) move a to b wht will be the value ? and 01 a pic x..

Answer / pradip

1.
000123

2.
abc---

Well arthi, here - stands for blank space, correct me if am
wrong

Is This Answer Correct ?    3 Yes 2 No

01 a pic 9(3) value is 123 01 b pic 9(6) move a to b wht will be the value ? and 01 a pic x..

Answer / praveen

Arati was correct. if you move x(6) varibale to x(3) there
will not be any blank spaces.

Is This Answer Correct ?    1 Yes 0 No

01 a pic 9(3) value is 123 01 b pic 9(6) move a to b wht will be the value ? and 01 a pic x..

Answer / cj

Numeric items are moved right to left (before the decimal
point) and left to right (after the decimal point) from
source item to the destination item.

So the answer for the first move=> Variable b will have
value 000123 in it. (In the question value 123 should be
within quotes)

Alphanumeric (as well as alphabetic) items are moved left to
right from source item to destination item.

So the answer for the second move=> Variable b will have abc
stored in it. (In the question value abc should be within
quotes)

Is This Answer Correct ?    1 Yes 0 No

01 a pic 9(3) value is 123 01 b pic 9(6) move a to b wht will be the value ? and 01 a pic x..

Answer / chowdary

after executing this program output will be

b value is 000123
and
b value is abc
there is no blanks after abc in b, because we have taken
its length as 3 in pic clause.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

How you can delete a record from a ps file in cobol?

1 Answers  


If we use GO BACK instead of STOP RUN in cobol?

2 Answers   Temenos,


What is Alternate Index ? How is it different from regular index ?

2 Answers  


If you were passing a table via linkage, which is preferable - a subscript or an index?

3 Answers   TCS,


Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefines a. 03 c occus 6 times pic 9. 02 d occurs 6 times pic 9. 03 e pic x(5) 03 f pic 999.

12 Answers  






I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

0 Answers   HCL,


Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.

2 Answers   RBS,


What are differences between Static Call and Dynamic Call?

10 Answers   IBM, KBC, Keane India Ltd, Verizon,


if a=b how the flow will complete??? perform test through test-exit. perform activa through activa-exit. test. if a=b then next sentence else move a to c. test-exit. exit. activa. -- -- activa-exit. exit.

1 Answers   IBM,


How to find whether a Flat file is empty or not without Reading a file in COBOL Program. (not using JCL)

9 Answers   Bank Of America,


What is the use of EVALUATE statement?

4 Answers   Tesco,


SUPPOSE I HAVE 60 CHARACTERS STING. IN THAT I WANT FIND OUT HOW MANY TIMES 'A'(ASSUME)WILL REPEATED AND I HAVE TO PASS 'E' IN PLACE OF 'A'ALONG THAT STRING.

2 Answers   Wipro,


Categories