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.
Answers were Sorted based on User's Feedback
Answer / elite group
c) PIC clause can't be specified the group item
| Is This Answer Correct ? | 18 Yes | 0 No |
Answer / 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 |
Answer / craig
In previous answer,
01 W-DATE-NUM PIC 9(6).
01 W-DATE REDEFINES W-DATE-NUM.
05 DD PIC 99.
05 MM PIC 99.
05 YY PIC 99.
should be the code block at the bottom, sloppy cut and
paste, sorry.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / sachin
We never specified pic clause on group level item.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / anshu puri
cobol dont allow to use PIC clause at 01 level
| Is This Answer Correct ? | 2 Yes | 7 No |
Define REDEFINE clause and Is it possible to have the redefine clause anywhere in the working storage section for a data name?
What are the different rules for performing sort operation?
What was removed from COBOL in the COBOL II implementation?
What are decleratives in COBOL ?
What is an in line PERFORM? When would you use it? Anything else to say about it?
In COBOL, what is the different between index and subscript?
0 Answers TryTechnicals Pvt Ltd,
What is file status 92?
How does IDMS communicate with CICS?
77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value zeros. move a to b what is the answers for both cases? IS it possible? Give me elementary move rules briefly......
How do get the result of your program directly on your pc?
I have 2 dimensional array with having 100 elements. So how to find the 11th item in an array?
What will happen if a variable is declared as below.. Explain with an example? Working storage section:- 01 WS-VARX PIC X(10) VALUE 'ABCDEFGHIJ'. 01 WS-VARN REDEFINES WS-VARX PIC 9(5) VALUE '12345'. What will happen I want Display WS-VARX and WS-VARN?