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

What is binary search?

3 Answers  


How do we get current date from system with century in COBOL?

0 Answers   Winsol Solutions,


i have two file one is ksds another one is esds i want store matching records in flat file how to you matching.

2 Answers   Wipro,


How do u sort the table for Search ALL? Is it only using ASCENDING KEY IS statement in occurs clause? If the data is input in non ascending order, will the ASC KEY IS automatically sort the data? or will it throw compile time error?

1 Answers   CTS,


What is the point of the REPLACING option of a copy statement?

3 Answers  






study the data discriptions and answer the questions given below i)01 ORDER RECORD 05 OUT-HEADER PIC X(50) 05 ITEM-COUNT PIC 99 05 OUT-ITEM PIC X(20) OCCURS 1 TO 20 DEPENDING ON ITEM-COUNT ii)01 NAME-AND-ADDRESS 05 N-AND-A-LINE OCCURES 5 05 LINE-LENGTH PIC P9 05 N-AND-A-CHAR PIC X OCCURS 1 TO 20 DEPENDING ON LINE-LENGTH iii)01 SALES-LIST 05 SALESMAN-COUNT PIC 99 05 SALES PIC 9(6) OCCURS 1 TO 100 DEPENDING ON SALESMAN-COUNT iv)01 ORDER-RECORD 05 NO-OF-BRANDS PIC 99 05 BRAND-PURCHASED OCCURS 1 TO 15 DEPENDING ON NO-OF-BRANDS which of the following is true? a.i) and iii) are valid b.i) and iv) are valid c.i) and iii) are not valid d.all are valid

4 Answers   TCS,


) How do u handle errors in BMS macro?

0 Answers   IBM,


what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.

1 Answers   Syntel,


COBOL Snippet: Tell where the control will when the below code execute IF (A=B) CONTINUE ELSE NEXT SENTENCE PERFORM <IMP-STMT> END-IF.

7 Answers   HCL,


I have two sequential files, FILE-1 and FILE-2. FILE-1 contains 2 columns(A,B) and FILE-2 contains 3 columns (C,D,E).I want an output file, FILE-3 which has all five columns with duplicates eliminated from column A.

3 Answers  


How to define variable 9(20) in COBOL, because compiler does not allow us to declare variables with Pic 9(18). Can anyone please let me know the answer... I know one answer to this question which is to use Compiler option Arith (Extend) during Compilation. It extends the maximum limit to 9(32)..Just wanted to know if there is any other way to extend this?

4 Answers   CSC, TCS,


Hi Devolopers.. i need ur help.. i have 3 years of exp in Manual testing and SQL, next month onwards i shifted in to MAINFRAME TESTING... i have ZERO Knowledge abt mainframes.... PLS SUGGEST ME WHAT I LEARN in AMEERPET? mainframe testing or mainframe total devolopment subject... AS a devoloper u know every thing tester what to do PLSSSSSSSSS help me ITS VERY URGENT...

1 Answers  


Categories