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

Have you code any new programs in COBOL ? What is the functionality of the programs?

2 Answers   Patni, Xansa,


how do u link sub pgm to main pgm ?

2 Answers   TCS,


If I want to increase the Limit in GDG. What should I do?

1 Answers   IBM,


Difference between lrecl, blksize among PS, PDS issues? i.e in jcl at dcb

1 Answers  


how can we get current dat and time thru cobol pgm

3 Answers   DELL,






How do you do in-line PERFORM?

4 Answers   Accenture,


I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different ways to update this column thru COBOL-DB2 program?

5 Answers  


what is the use of outrecord?

0 Answers  


what is mainframe? what is the mainframe software ? what is use in s/w field?

7 Answers   CSE,


Will the variable POS in the following code have a value of 2 or not? 01 POS PIC S9(4) COMP VALUE 2. 01 FIRST-NAME PIC X(10) VALUE 'ABC'. 01 LAST-NAME PIC X(10) VALUE 'XYZ'. 01 NAME PIC X(20) VALUE SPACES. STRING FIRST-NAME DELIMITED BY SPACES ' ' DELIMITED BY SIZE LAST-NAME DELIMITED BY SPACES INTO NAME WITH POINTER POS

2 Answers  


is this below syntax correct? CALL 'subprg' using A,B Please help

2 Answers  


How do you get the data to code the BMS macro?

0 Answers   IBM,


Categories