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
How to print 10 to 1 if the input have only 10 digit number?
What is Pic 9v99 Indicates in COBOL?
What rules are followed by the search verb.
What is redefines clause in COBOL?
Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.
How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?
What is the difference between structured cobol programming and object alternativelyiented cobol?
What are the access modes of START statement?
What kind of error is trapped by on size error option?
What is the difference between perform … with test after and perform … with test before?
what is amode(24), amode(31), rmode(24) and rmode(any)?
What are the rules of the move verb?
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
What the difference is between continue and next sentence?
example for sub strings ? and refernce modifications whit output pls