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.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why would you use find and get rather than to obtain?

692


What are the different rules of SORT operation?

702


In which area will you utilize 88 level items in cobol?

724


Explain the configuration section of a cobol program with examples of syntax.

661


What are the different rules for performing sort operation?

766






What is the difference between perform … with test after and perform … with test before?

885


how to move the records from file to array table. give with code example

2223


What are declaratives and what are their uses in cobol?

714


What is rmode(24)

683


Write a program that uses move corresponding.

676


how do you reference the variable block file formats from cobol programs

688


how do you reference the printer file formats from cobol programs

669


A table has two indexes defined. Which one will be used by the SEARCH?

759


)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?

1525


What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?

679