View previous topic :: View next topic
|
Author |
Message |
raghav08 Currently Banned New User
Joined: 03 Jun 2008 Posts: 94 Location: Bangalore
|
|
|
|
Hi,
Why do we need to declare OCCURS clause other than 01 level ? Any specific reason, please.
(I could not see any past discussion on this, if any please provide.)
Thanks. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Because that's the COBOL rule, plain and simple....
Bill |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
one way to look at this:
a table item is addressed
Quote: |
as a displacement from the beginning of the table
|
according to the manual, a table is defined within a group item with an occurs clause.
if the occurs clause were to be declared at the 01 level, there would be no group item,
thus no beginning of table resolution.
another perspective:
01 represents a logical record. Occurs clause is used to repeat fields with same format, not the records. |
|
Back to top |
|
|
raghav08 Currently Banned New User
Joined: 03 Jun 2008 Posts: 94 Location: Bangalore
|
|
|
|
Hi.
The second answer sounds good.
Quote: |
01 represents a logical record. Occurs clause is used to repeat fields with same format, not the records.
|
Thanks |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
But the first answer is the answer to your question.
The 2nd answer is the answer to the question: "Why did the COBOL committee require this restriction in the language definition?"
Both good questions. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi raghav,
It may be that they wanted to assure that they always provided something to reference the ENTIRE table, e.g. for a MOVE. |
|
Back to top |
|
|
|