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 are the various section in data division and briefly explain them.
What is amode(24)?
if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.
How to remove the spaces at the end of each record in the output file of variable length, via cobol program?
What is rmode(24)
what is difference between cobol and cobol/400
What is the usage of comp fields in cobol?
What are literals?
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
What guidelines should be followed to write a structured cobol prgm?
What are the pertinent COBOL
how do you reference the fixed unblock file formats from cobol programs
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
For rewrite, why is it mandatory that file needs to be opened?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning