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

In a program, there are 2 sections defined say SECTION-A and SECTION-B. There is a paragraph say CALC-INT in both the sections. If this para has to be called directly for SECTION-A, then PERFORM CALC-INT will not work as it is present in both sections. How the PERFORM statement has to be coded here?

5 Answers  


RENAME clause takes new SPACE in memory.TRUE or FALSE? a)TRUE 2)FALSE

12 Answers   TCS,


If A>B next sentence end-if display 1 display 2. display 3. If a>b, it will display only 3.(the next sentence, ie., after fullstop/period) ____________________________________ if a>b continue end-if display 1 display 2. display 3. If a>b, it Will display 1 2 3 (the next statement) ____________________________________ if a>b continue display 1 end-if display 2 display 3. display 4. If a>b, Will it display 2 3 4 (or) 1 2 3 4 ?

8 Answers   UST,


give the examples of strings in cobol

1 Answers   IBM,


there is a file whose ORGANISATION is INDEXED.you want to read the records from the file in RANDOM fashion as well as sequentially.then which of the access mode would you specify? a.SEQUENTIAL b.RANDOM c.DYNAMIC D.ACCESS MODE has nothing to do with it

3 Answers   TCS,






Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

0 Answers  


u have passed sme charecters thru parm parameter in jcl. how do u code in cobol to recieve the values u gave in parm ?

2 Answers   IBM,


1.Can we define condition-name conditions in FD entry.

11 Answers  


Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

0 Answers  


What compiler option would you use for dynamic linking?

2 Answers  


What is rmode(any) ?

0 Answers  


What is the difference between Call and a Link?

0 Answers  


Categories