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
What is the default value(s) for an initialize and what keyword allows for an override of the default?
what is search and searchall?what is the diffrence between them?give an best example?
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
what is the use of outrecord?
what happens if parmparameter passes zero bytes to the program
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
Discuss about changing dataset name in proc.
What is an in line perform? When would you use it? Anything else you wish to say about it.
) how do u code after getting data?
Explain how you can characterize tables in cobol?
what is amode(24), amode(31), rmode(24) and rmode(any)?
how do you reference the printer file formats from cobol programs
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
explain sorting techniques in cobol program?
What is the difference between Call and a Link?