a pic s9(4) comp
b pic s9(4) comp-3
c ????????????????
d ????????????????
move a to c
add a+B giving d.

what is ur declaration for c,d?

Answers were Sorted based on User's Feedback



a pic s9(4) comp b pic s9(4) comp-3 c ???????????????? d ???????????????? move a to c add a+B g..

Answer / mithlesh

since A is the comp field it takes 2 bytes space and B is
the comp-3 field it takes 3 bytes .

Now for the the declaration C and D they must be declaraed
into s9(4) and S9(5) pic caluse.

Is This Answer Correct ?    3 Yes 0 No

a pic s9(4) comp b pic s9(4) comp-3 c ???????????????? d ???????????????? move a to c add a+B g..

Answer / lu

before answering this questions, i say "you need to code
PROPERLY, CORRECTLY" ok ....you add S9() comp to S9() comp.
comp-3 with comp-3...ok...

Is This Answer Correct ?    0 Yes 0 No

a pic s9(4) comp b pic s9(4) comp-3 c ???????????????? d ???????????????? move a to c add a+B g..

Answer / vinodquestion

I dont know what you need mr. LU. My question is in place of '?' what do you code for that manipulations.. i.e give declarations for c,d and it satisfies both move,add operations.. if it is not possible give me your conclusion...

Is This Answer Correct ?    0 Yes 0 No

a pic s9(4) comp b pic s9(4) comp-3 c ???????????????? d ???????????????? move a to c add a+B g..

Answer / abhay

C should be declared as S9(04)
D should be declared as s(05)

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

What is comp-1 and comp-2?

0 Answers  


A LESS 1200 IF B GREATER 25 MOVE 47 TOC ELSE MOVE 57 TO C IF A GREATER 249 MOVE 67 TO C ELSE NEXT SENTENCE ELSE IF B LESS 67 MOVE 27 TO C What will be the value of C, when A is 137 and b is 25

3 Answers   TCS,


How to define variable 9(20) in COBOL, because compiler does not allow us to declare variables with Pic 9(18). Can anyone please let me know the answer... I know one answer to this question which is to use Compiler option Arith (Extend) during Compilation. It extends the maximum limit to 9(32)..Just wanted to know if there is any other way to extend this?

4 Answers   CSC, TCS,


what is jcl approach for programming?

4 Answers   IBM,


There are two flat files one having 10 records and other having 5 records. write a cobol pgm to find the duplicate records(matching records)from both files.

1 Answers   Mind Tree,






01 MOVE 10 TO N 05 PERFOM PARA1 TIMES STOP RUN WAT WILL HAPPEN?? WILL IT RUN INFINITELY OR AN ERROR WIL BE THER BECAUSE NO OF TIMES IS NOT GIVEN??

1 Answers  


how we separate the cobol cics statements from cobol&cics programming?

1 Answers   Valtech,


How to concatenation one or more string?

4 Answers   Temenos,


what is index and how to use two tables using index?

1 Answers  


What are ISOLATION LEVELS? Where do we need to specify them?

3 Answers   EXL,


In EBCDIC, how would the number 1234 be stored?

2 Answers   TCS,


What is the difference between copy and include in cobol?

1 Answers  


Categories