From: Frank Swarbrick on
>>> On 11/14/2007 at 3:10 PM, in message
<473B0FEA.6F0F.0085.0(a)efirstbank.com>,
Frank Swarbrick<Frank.Swarbrick(a)efirstbank.com> wrote:
> I've wondered this for a long time... Why is there a restriction that an
> OCCURS clause cannot occur at level 01 or 77? For instance, why not
>
> 01 TRANS-MORE-CNT OCCURS 4
> PIC S9(7) COMP-3 VALUE ZERO.
>
> Or even
>
> 77 TRANS-MORE-CNT OCCURS 4
> PIC S9(7) COMP-3 VALUE ZERO.
>
> Rather than something silly like...
>
> 01.
> 05 TRANS-MORE-CNT OCCURS 4
> PIC S9(7) COMP-3 VALUE ZERO.
>
> It's always bugged me.

Thanks for all of the answers.
Seems to me that it would be easy to solve the FILE SECTION issue by making
a rule that OCCURS is not allowed at level 1 or 77 in the FILE SECTION. As
for being synchronized there could be a rule that only the first byte of an
01 record need be synchronized. (Probably didn't state that well enough for
a standard, but it hardly matters as it obviously will never make it
there...)

Ah well.

Frank

From: Richard on
On Nov 15, 11:42 am, "William M. Klein" <wmkl...(a)nospam.netcom.com>
wrote:
>
> FD File-1.
> 01 Rec-Table occurs 10 times.
> ....


In an FD area all 01 records implicitly redefine each other. The
occurs means that (theoretically) there are 10 01 level entries, each
of which is a redefinition of the other 9.

Rec-Table(1) is the same (or should be) data area as Rec-Table(2).


From: William M. Klein on
Richard,
I am not certain that I agree with this. It is true that in a STANDARD
CONFORMING implementation (and source code) that all 01-levels are implicit
redefines. However, if an implementation creates an extension that allows
NON-STANDARD occurs at the 01-level, then I think it is UP TO THE IMPLEMENTER
what this means. Certainly, ONE approach would be that each element is a
"redefines". However, another would be that there is an "implicit" group
01-level ABOVE the data description with the OCCURS.

Telling an implementer how they MUST create an extension is a "non-starter"
(from my perspective).

--
Bill Klein
wmklein <at> ix.netcom.com
"Richard" <riplin(a)azonic.co.nz> wrote in message
news:6d41815e-a480-4d78-837e-979730ba94b3(a)d27g2000prf.googlegroups.com...
> On Nov 15, 11:42 am, "William M. Klein" <wmkl...(a)nospam.netcom.com>
> wrote:
>>
>> FD File-1.
>> 01 Rec-Table occurs 10 times.
>> ....
>
>
> In an FD area all 01 records implicitly redefine each other. The
> occurs means that (theoretically) there are 10 01 level entries, each
> of which is a redefinition of the other 9.
>
> Rec-Table(1) is the same (or should be) data area as Rec-Table(2).
>
>


From: Richard on
On Nov 30, 11:57 am, "William M. Klein" <wmkl...(a)nospam.netcom.com>
wrote:
> Richard,
> I am not certain that I agree with this. It is true that in a STANDARD
> CONFORMING implementation (and source code) that all 01-levels are implicit
> redefines. However, if an implementation creates an extension that allows
> NON-STANDARD occurs at the 01-level, then I think it is UP TO THE IMPLEMENTER
> what this means. Certainly, ONE approach would be that each element is a
> "redefines".

Do you know of any implementation where this is not the case in an
FD ?

> However, another would be that there is an "implicit" group
> 01-level ABOVE the data description with the OCCURS.

That would make it rather hard to do a WRITE when the "00 group level"
is implicit and has no name.

> Telling an implementer how they MUST create an extension is a "non-starter"
> (from my perspective).

Of course they could design their own language which is not like Cobol
at all.