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 the default value(s) for an initialize and what keyword allows for an override of the default?

687


what is search and searchall?what is the diffrence between them?give an best example?

5537


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

671


what is the use of outrecord?

1765


what happens if parmparameter passes zero bytes to the program

1651






Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

701


Discuss about changing dataset name in proc.

757


What is an in line perform? When would you use it? Anything else you wish to say about it.

639


) how do u code after getting data?

1576


Explain how you can characterize tables in cobol?

636


what is amode(24), amode(31), rmode(24) and rmode(any)?

688


how do you reference the printer file formats from cobol programs

648


What is the default value(s) for an initialize? What keyword will allow for an override of the default?

650


explain sorting techniques in cobol program?

684


What is the difference between Call and a Link?

694