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
Can a Search can be done on a table with or without Index?
What is the difference between a binary search and a sequential search what are the pertinent cobol?
What is the default value(s) for an initialize and what keyword allows for an override of the default?
What is the difference between PIC 9.99 and 9v99 in COBOL?
What is the difference between binary search and sequential search?
What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?
what is s000 u4087 error? please give the all error codes in cobol,jcl.
What is amode(31)
What is comp-1 and comp-2?
how do you reference the fixed unblock file formats from cobol programs
How do you differentiate between cobol and cobol-ii?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?
Why occurs cannot be used in 01 level in COBOL?
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that