What is wrong with the following data declaration?
01 W-DATE PIC X(6).
05 DD PIC 99.
05 MM PIC 99.
05 YY PIC 99.
(a) Nothing is wrong.
(b) Under W-DATE all level 05 items are having a PIC 99 but
level
01 has PIC X(6).
(c) PIC can't be specified for a group item.
(d) DD, MM, and YY are invalid datanames.

Answer Posted / craig

01 W-DATE PIC X(6).
05 DD PIC 99.
05 MM PIC 99.
05 YY PIC 99.

is incorrect.

01 W-DATE.
05 DD PIC 99.
05 MM PIC 99.
05 YY PIC 99.
Is correct, and W-DATE has an implied picture clause of
PIC X(6). Group items are always character in usage. To
use a group item that requires another picture clause, you
must do a redefines, ie.
01 W-DATE-NUM PIC 9(6).
01 W-DATE PIC X(6) REDEFINES W-DATE-NUM.
05 DD PIC 99.
05 MM PIC 99.
05 YY PIC 99.

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a scope terminator give example?

657


What rules are to be followed while using the corresponding options?

641


Explain how you can characterize tables in cobol?

638


What is Pic 9v99 Indicates in COBOL?

729


What are the pertinent COBOL commands?

2626






How many bytes S(8) comp field occupy and its maximum value?

1632


explain sorting techniques in cobol program?

690


What are the different open modes available in cobol?

722


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

2723


What is the difference between external and global variables in COBOL?

813


Can we redefine the field of x(200) to less than 200?

820


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.

5065


What is amode(31)

724


what is the difference between COBOL2 AND COBOL390?

2453


What is the problem of ordered sequential files access?

702