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 |
I got user abend U4038 while compiling my runjcl.. can anyone help me?
if a=b how the flow will complete??? perform test through test-exit. perform activa through activa-exit. test. if a=b then next sentence else move a to c. test-exit. exit. activa. -- -- activa-exit. exit.
i want to store 20 digits . h will u do it in cobol ?
What is the difference between COMP & COMP-3 ?
can we use 77 level no for Redefines?if we use give an example?
what is sort? whis is internal & external sort ?when do u go for inter sort & external sort? tell about some sort utilites?
I've one string with spaces ( I N D I A ). My question is I want remove the spaces & combine in to single string without space (INDIA).How we can write the cobol program & wich options we need to use. Please let me know.
How to resolve the soc4 and soc7 errors?
I HAVE FOLLOWING DECLARATION. 02. A PIC X(10) VALUE 'XXXXXXXXXX'. 02. B REDEFINES A. 05. C PIC X(3). 05. D PIC X(3). 05. E PIC 9(3). IN MY PROG, I HAVE MOVE 1 TO E. DISPLAY A. WHAT WILL BE DISPLAYED AS A RESULT OF THIS? PLEASE EXPLAIN THE ANSWER. THANKS.
what is a load module ?
What rules are followed by the search verb.
What is the difference between a DYNAMIC and STATIC call in COBOL?