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



What is wrong with the following data declaration? 01 W-DATE PIC X(6). 05 DD PIC 99. ..

Answer / elite group

c) PIC clause can't be specified the group item

Is This Answer Correct ?    18 Yes 0 No

What is wrong with the following data declaration? 01 W-DATE PIC X(6). 05 DD PIC 99. ..

Answer / rohit

c) PIC can't be specified for a group item.

Is This Answer Correct ?    8 Yes 0 No

What is wrong with the following data declaration? 01 W-DATE PIC X(6). 05 DD PIC 99. ..

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

What is wrong with the following data declaration? 01 W-DATE PIC X(6). 05 DD PIC 99. ..

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

What is wrong with the following data declaration? 01 W-DATE PIC X(6). 05 DD PIC 99. ..

Answer / sachin

We never specified pic clause on group level item.

Is This Answer Correct ?    1 Yes 0 No

What is wrong with the following data declaration? 01 W-DATE PIC X(6). 05 DD PIC 99. ..

Answer / anshu puri

cobol dont allow to use PIC clause at 01 level

Is This Answer Correct ?    2 Yes 7 No

Post New Answer

More COBOL Interview Questions

subscript and index r not coded in u r application program what will happen?

2 Answers  


How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?

0 Answers  


Identify the invalid dataname from the following: (A) savings-account (B) annual-allocation-for-overhead (C) samount250 (D) 12demand

4 Answers   TCS,


How many divisions we have in Cobol ?

4 Answers   Wipro,


Can a Search can be done on a table with or without Index?

0 Answers  






Can we change the password using ALTER? anyone tried and changed?

0 Answers   IBM,


what is S04E error in jcl?

11 Answers   IBM, L&T,


If I want to increase the Limit in GDG. What should I do?

1 Answers   IBM,


In the JCL, how do you define the files referred to in a subroutine ?

2 Answers  


I have one column say 'X' defined as VARCHAR Can anyone tell me What are the different ways to update this column thru COBOL-DB2 program?

5 Answers  


How we copy a program from production region to development region.What is the process & syntax ?

3 Answers   CTS,


how we rectify soc7 and soc4 errors in project?

1 Answers   Anaxis, TCS,


Categories