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 / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are literals?

855


Why did you choose to work with ibm mainframe cobol programming?

850


What are different data types in cobol?

910


) how do u code after getting data?

1798


Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.

5423


2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic

2360


What kind of error is trapped by on size error option?

960


What happens when we move a comp-3 field to an edited (say z (9). Zz-)?

1031


How do you reference the fixed block file formats from cobol programs

913


what happens if parmparameter passes zero bytes to the program

1877


What is the difference between goback, stop run and exit program in cobol?

1228


Explain how you can characterize tables in cobol?

821


What is Pic 9v99 Indicates in COBOL?

934


What are all the divisions of a COBOL program?

894


How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?

860