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



what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9..

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

what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9..

Answer / asmara

nothing is wrong in the IF statement

Is This Answer Correct ?    2 Yes 0 No

what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9..

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

what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9..

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

what if any ,is the syntex error in the following piece of code 01 B PIC A(7) 02 C PIC 9..

Answer / ts nithiyanandan

answer is a
IF B Numeric (correct syntax)
IF (B Numeric) (incorrect syntax)

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More COBOL Interview Questions

why occurs clause not mentioned in 01 level

6 Answers   HCL, NIIT, TCS, Tesco,


in cobol i have one file it contains records like 10,4,23,98,7,90..... total records 100. iwant 10 to 20 in reverse order in cobol environ ment any one please give the answer......

2 Answers   IBM,


consider the following PROCEDURE DIVISION entry OPEN EXTEND IN-FILE identify the correct statement a.organization of IN-FILE is sequential and records can be added in the beginning b.organization of IN-FILE is sequential and records can be added in the end c.organization of IN-FILE is indexed and records can be added in the beginning d.organization of IN-FILE is indexed and records can be added in the end

3 Answers   TCS,


How to delete leading spaces/blank in COBOL ? Example:- 01 data-name-1 pic x(220) " English is a language". I would like to delete leading spaces.

7 Answers   Financial Services,


How to replace the GOTO statement in COBOL without changing the structure of program. e.g. consider following code... I.D. E.D. D.D. P.D. compute C = A + B. GOTO para 100-display. compute D = C - D. GOTO 200-display. some other logic...... ........ GOTO 300-para. ...... ...... GOTO 400-para. Now I want to replacce all GOTO statements without changing the structure and otput of program.

6 Answers   Accenture,






What is the meaning of 'TALLING' verb in cobol?

5 Answers  


whn do i get soc7 abend while moving alphanumeric to numeric or while moving numeric to aplhanumeric please reply ASAP?

9 Answers  


COMP-3 field occupy ?

8 Answers  


What is the difference between PIC 9.99 and 9v99?

7 Answers  


in how many mode we can open a file ?

4 Answers  


study the following code 01 A1 05 B PIC 99 05 C PIC X(4) 01 A2 05 B PIC 99V99 05 C PIC A(4) pick out the valid statement from the following a.A1 and A2 can not have sub-ordinates b.A1 and A2 can have the same sub-ordinates but must have same PIC clause c.there is nothing wrong d.A1 and A2 can have same sub-ordinates provided they are not at 01 level

4 Answers   TCS,


Difference between lrecl, blksize among PS, PDS issues? i.e in jcl at dcb

1 Answers  


Categories