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 |
Have you code any new programs in COBOL ? What is the functionality of the programs?
how do u link sub pgm to main pgm ?
If I want to increase the Limit in GDG. What should I do?
Difference between lrecl, blksize among PS, PDS issues? i.e in jcl at dcb
how can we get current dat and time thru cobol pgm
How do you do in-line PERFORM?
I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different ways to update this column thru COBOL-DB2 program?
what is the use of outrecord?
what is mainframe? what is the mainframe software ? what is use in s/w field?
Will the variable POS in the following code have a value of 2 or not? 01 POS PIC S9(4) COMP VALUE 2. 01 FIRST-NAME PIC X(10) VALUE 'ABC'. 01 LAST-NAME PIC X(10) VALUE 'XYZ'. 01 NAME PIC X(20) VALUE SPACES. STRING FIRST-NAME DELIMITED BY SPACES ' ' DELIMITED BY SIZE LAST-NAME DELIMITED BY SPACES INTO NAME WITH POINTER POS
is this below syntax correct? CALL 'subprg' using A,B Please help
How do you get the data to code the BMS macro?