gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] runtime error with open cobol


From: Keisuke Nishida
Subject: Re: [open-cobol-list] runtime error with open cobol
Date: Fri Feb 20 19:04:14 2004
User-agent: Wanderlust/2.10.0 (Venus) SEMI/1.14.3 (Ushinoya) FLIM/1.14.3 (Unebigoryƍmae) APEL/10.3 Emacs/21.2 (i386-redhat-linux-gnu) MULE/5.0 (SAKAKI)

At Tue, 17 Feb 2004 18:16:10 -0600,
William M. Klein wrote:
> 
> The definition of
>    AW-SYSUT1-WA1.
> 
> is "illegal" according to the '85 (and 2002) ANSI Standard.  This is because
> there is an ODO (Occurs Depending On) tjat fp;;pws amptjer ODO within the
> SAME 01-level.  This is documented as an IBM extension at:
>  
> http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3LR10/APPENDIX
> 1.1 
> 
> with the description,
> 
> "Complex OCCURS DEPENDING ON
> [Standard COBOL requires that an entry containing OCCURS DEPENDING ON be
> followed        only by subordinate entries, and that no entry containing
> OCCURS DEPENDING ON be           subordinate to an entry containing OCCURS
> DEPENDING ON.]"
> 
> However, the really "tricky" part of this is that exactly HOW this works is
> NOT consistent across IBM mainframe COBOLs.  See (for example) the topic,
> 
> "OCCURS DEPENDING ON clause--value for receiving items changed"
> at:
>  http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/igy3mg10/4.1.7 
> 
> You might also want to compare this with the "Substantive change potentially
> effecting" number 8 on page XVII-55 on the '85 Standard.
> 
> Bottom-Line:
>   Behavior of complex ODO (as an extension to the ANSI/ISO Standards) needs
> to be VERY sensitive to EXACTLY what extension is being emulated (different
> compilers give different results - and each implementor may LEGALLY define
> whatever extension they want)

Thank you for the reference.  This is quite complex indeed.

It seems data items defined after an ODO item are called
variably-located item, whose location may change depending on
the first ODO.  This is not too hard to implement, so I'll
do it soon.

However, I have a question about the complex ODO.  What is
the expected result of the following code?

  01 I-1 PIC 9.
  01 I-2 PIC 9.
  01 G.
    02 X PIC X OCCURS 1 TO 5 DEPENDING ON I-1.
    02 Y PIC X OCCURS 1 TO 5 DEPENDING ON I-2.

  MOVE 3 TO I-1 I-2.
  MOVE "1234567890" TO G.
  DISPLAY G.

"123456", "123678", or error?

Keisuke


reply via email to

[Prev in Thread] Current Thread [Next in Thread]