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 a scope terminator give example?
What rules are to be followed while using the corresponding options?
Explain how you can characterize tables in cobol?
What is Pic 9v99 Indicates in COBOL?
What are the pertinent COBOL commands?
How many bytes S(8) comp field occupy and its maximum value?
explain sorting techniques in cobol program?
What are the different open modes available in cobol?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What is the difference between external and global variables in COBOL?
Can we redefine the field of x(200) to less than 200?
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.
What is amode(31)
what is the difference between COBOL2 AND COBOL390?
What is the problem of ordered sequential files access?