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

Can the OCCURS clause be at the 01 level?

2 Answers  


Why do we use COMP-3 variables for computation, when we know that they are non displayable fields and require additional MOVE to numeric field before we populate it in output Reports?

1 Answers   Accenture,


input:- 12233344445555566666... output:- 1=1,2=4,3=9... Here firstno i.e 1 should be displayed and after that the alikeno.s should be added n displayed.i.e 2+2=4 like tat it goeson.

1 Answers  


How to read a 100 record from a file through cobol?

2 Answers  


how we rectify soc4 and soc7 error in project(need real time answer)? please reply

3 Answers   HCL, Wipro,






I have a cobol program with a sub program. How ca i find that it is a dynamic call? or static call..?

3 Answers   HCL, IBM,


I have sequential file recl 1000 i want to add another 15 bytes to it. The record length should not change..How?

1 Answers   CTS, HCL,


What is the difference between PIC 9.99 and 9v99 in COBOL?

0 Answers   SwanSoft Technologies,


i am a btech cs 2009 passout. i am opting for mainframe course. is it good to do this course? pls. anyone suggest me

4 Answers  


which is better comp or comp-3 in terms of memory utilization?

6 Answers  


) How do u handle errors in BMS macro?

0 Answers   IBM,


Discuss about changing dataset name in proc.

0 Answers  


Categories