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 |
In COBOL "BEFORE" advancing is there or not ?
What is reference modification? What is UNION in sql and syntax? What is the difference between GDGS and VSAM? Which is prefer one? What is processing groups in endevor?
The order of precedence of arithmetic operators in an expression can be overridden with the use of (a) [] (b) () (c) {} (d) Any of the above
i want to enter the name 'pandu' into ur table how?
EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?
In an array processing what is the thing that can be done by using subscripts but not by using index
How do you define a variable of COMP-1? COMP-2?
what is filler and what is use of filler
What is the difference between a DYNAMIC and STATIC call in COBOL?
Hi , I am posting some questons which are asked at interview. These may help u for ur interview... what is static and dynamic call?
given the following: 77 A PIC 9V9 VALUE 9.5 77 B PIC 9 VALUE 9. 77 C PIC V9 VALUE 0.8 77 D PIC 9 77 E PIC 9 77 F PIC 9V999 what are the contenta of D E nad F after the following statements are executed: COMPUTE F ROUNDED=A+C/B MULTIPLY A BY C GIVING E ADD B C A GIVING D ROUNDED a.F=9.589 E=8 D=1 b.F=9.589 E=8 D=9 c.F=9.589 E=7 D=9 d.F=9.589 E=7 D=1
In COBOL, what is the different between index and subscript?
0 Answers TryTechnicals Pvt Ltd,