what if any ,is the syntex error in the following piece of code
01 B PIC A(7)
02 C PIC 9(4)
........
IF(B NUMERIC)
ADD 10 TO C
a.the condition in the if statement is wrong
b.noting is wrong
c.because C is initialised.ADD 10 TO C is wrong
d.both B and C shoud have same size.

Answers were Sorted based on User's Feedback



what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9..

Answer / shri

Field 'B' is a group level field (Since field 'C' is
defined under it at 02 level. Now field 'B' being a group
level field cannot have PIC clause. This is first syntex
error.
Further the condition IF (B Numeric) is not a system error
and is a correct cobol statement

Is This Answer Correct ?    6 Yes 1 No

what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9..

Answer / asmara

nothing is wrong in the IF statement

Is This Answer Correct ?    2 Yes 0 No

what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9..

Answer / vish

the syntax is wrong..a couple of mistakes...

1. The level of C is 02 which means it is a sublevel of B.
hat being the case B becomes the group level item and hence
the PIC clause for B is invalid.

2. The conditional statement is wrong, correct sysntax can
be either ib below:
IF (B IS NUMERIC)
ADD 10 TO C

IF B IS NUMERIC
ADD 10 TO C

Basically 'IS' is missing from the statement.

Is This Answer Correct ?    3 Yes 1 No

what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9..

Answer / ramesh

HI Vish,
We can use 02 level to describe C.
Only Mistake seems to be Wrong Syntax.
Thanks
Rameshkumar.H.K.
Infosys

Is This Answer Correct ?    1 Yes 2 No

what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9..

Answer / ts nithiyanandan

answer is a
IF B Numeric (correct syntax)
IF (B Numeric) (incorrect syntax)

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More COBOL Interview Questions

I got user abend U4038 while compiling my runjcl.. can anyone help me?

10 Answers   CGI,


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,


i want to store 20 digits . h will u do it in cobol ?

4 Answers   TCS,


What is the difference between COMP & COMP-3 ?

2 Answers  


can we use 77 level no for Redefines?if we use give an example?

3 Answers   Mphasis,






what is sort? whis is internal & external sort ?when do u go for inter sort & external sort? tell about some sort utilites?

2 Answers   BirlaSoft,


I've one string with spaces ( I N D I A ). My question is I want remove the spaces & combine in to single string without space (INDIA).How we can write the cobol program & wich options we need to use. Please let me know.

10 Answers   Mascon,


How to resolve the soc4 and soc7 errors?

5 Answers   IBM, RBS,


I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. 05. C PIC X(3). 05. D PIC X(3). 05. E PIC 9(3). IN MY PROG, I HAVE MOVE 1 TO E. DISPLAY A. WHAT WILL BE DISPLAYED AS A RESULT OF THIS? PLEASE EXPLAIN THE ANSWER. THANKS.

7 Answers   Amdocs,


what is a load module ?

3 Answers   TCS,


What rules are followed by the search verb.

0 Answers  


What is the difference between a DYNAMIC and STATIC call in COBOL?

2 Answers  


Categories