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
Which Search verb is equivalent to PERFORM…VARYING?
What are declaratives and what are their uses in cobol?
Mention the guidelines to write a structured cobol program?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
What is the problem of ordered sequential files access?
How do you define a variable of comp-1 and comp-2?
explain sorting techniques in cobol program?
Name the divisions, which are available in a cobol program?
) How do u handle errors in BMS macro?
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.
here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?
Have you used comp and comp-3 in your project? And how?
What are the different rules of SORT operation?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
What is the difference between next sentence and continue in cobol programing language?