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 |
what are the error codes in cobol, db2, cics, vsam , and jcl
How can you add a particular field/coloumn in copybook?
wht do u mean by (*,intrdr) wht is * used for ?
We are using the searching a table which is indexed, once the key is found, how can we get the occurance at which the key was found.
i have two file, each file having : file1 is having 2 fields field1 field2 file2 is having 3 fields field1 field2 field3 my req is to make it one file like: field1 field2 field1 field2 field3 if anyone know please send me syntax, i tried this with DFSORT but could not succeed.
whats the difference between search and search all?
what is subscript in cobol?give realtime example?
how to remove leading spaces and zeroes in a cobol variable.is there any easy way to do it
soc-7 is a bad data,invalid data. when ever we are moving the alphabets in the position of numeric then we got this abend. so my question is if o1 ws-data pic 9(1) value passing the alphabet some x. then we got soc-7 or not? i want clarification ?
how to move the records from file to array table. give with code example
There is a production file which has millions of records in it.The program that uses it ends up with an SOC7 abend.It is sure that the abend is due to some invalid data in the file.Is there any way to debugg the SOC7 abend with out giving displays? I need the record which is cause for the abend.
What will happen if we try to create GDG (+2) generaton instead of (+1) generation?