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
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
Why would you use find and get rather than to obtain?
What is the usage of comp fields in cobol?
how do you reference the variable block file formats from cobol programs
How do you reference the fixed block file formats from cobol programs
I have to write to a outfile where the number of records in that file should be the header of that file using IMS.. can anyone help me in this issue
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
What is the difference between perform … with test after and perform … with test before?
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?
What is the default value(s) for an initialize and what keyword allows for an override of the default?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
What is rmode(any) ?
What is Pic 9v99 Indicates in COBOL?
What are 77 levels used for?