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

How to declare if emp-name = AAAAA""BBB in working-storage section. After display emp-name should print like AAAAA""BB

6 Answers   Polaris,


What is the difference between Call and a Link?

0 Answers  


) how do u code after getting data?

0 Answers   IBM,


Hi all, I have a following requirement to write the cobol program. I have to load the 129 variables from input sequential file which are in excel sheet to the cobol inernal table. and after loading into table i have to compare this data with the business file. here compare means controlling the data whether the format(numeric,alpha) is same in the business file and in the table??? i have the same data in input and business file. could anyone please give me any idea of the logic?// i have all the 129 different variables(129rows,1 column)is there .

4 Answers   IBM, Syntel, TCS,


how will you define vsam file in select clause?

3 Answers   Patni,






WHAT IS SOC3?HOW IT CAN BE RESOLVED?

1 Answers  


Define REDEFINE clause and Is it possible to have the redefine clause anywhere in the working storage section for a data name?

3 Answers  


what is label record is standard or omitted in file description of data division?

3 Answers   IBM, TCS,


What type of SDLC u followed? Why?

0 Answers   IBM,


How to retrive the 9th records out of ten records using the cobol program ?

3 Answers   UST,


i have mainprogram and subgram...if i compile mainprogram without stop run..what will u get in compilation time?

1 Answers   HCL,


in cobol main pgm is calling sub pgm but sub pgm does not exists , what abend i get if submit the job?

2 Answers   HSBC,


Categories