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
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 |
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 |
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 |
Answer / ts nithiyanandan
answer is a
IF B Numeric (correct syntax)
IF (B Numeric) (incorrect syntax)
| Is This Answer Correct ? | 0 Yes | 2 No |
is this below syntax correct? CALL 'subprg' using A,B Please help
what is the difference b/w level no.01 & level no.77?
01 b pic +9(4) How many bytes it will take for storage???
Can the OCCURS clause be at the 01 level?
What is the different between index and subscript?
a pic s9(4) comp b pic s9(4) comp-3 c ???????????????? d ???????????????? move a to c add a+B giving d. what is ur declaration for c,d?
how many maximum no of variables can be declared in linkage section ?
I have 100 records in a file.. i want to sort the records from 5 to 5o... give the syntax...
BY seeing a program how can we say that it is static call or dynamic call
How many sections are there in data division in COBOL?
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?
What is the difference between PIC 9.99 and 9v99 in COBOL?
0 Answers SwanSoft Technologies,