Subject: | |
From: | |
Reply To: | |
Date: | Mon, 1 Dec 2003 17:48:24 -0600 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Hi Alan, the manual is correct. (The ANSI std basically says the same
thing as the manual). It looks like a bug in the compiler. I tried the
'Not allowed' example and it (incorrectly) compiled cleanly.
Alan Yeo wrote:
> Hi COBOL Fans
>
> Just come across the following Array definition, which HP COBOL II seems
> to compile quite happily, although as you can see from the extract from
> the on-line COBOL manual it says is not allowed.
>
> Is the manual wrong, is it correct but the compiler just happens to
> allow it by mistake, is it an undocumented COBOL II extension? Or does
> the GLOBAL alter anything?
>
> 019700 01 OUTPUT-B IS GLOBAL.
> 019800 05 TOT-REC PIC S9(04) BINARY SYNC.
> 019900 05 H-REC-LEN PIC S9(04) BINARY SYNC.
> 020000 05 SEND-MSG OCCURS 1 TO 160 TIMES
> 020100 DEPENDING ON TOT-REC.
> 020200 10 SEND-BYTE OCCURS 1 TO 80 TIMES
> 020300 DEPENDING ON H-REC-LEN
> 020400 PIC X(01). HELPDATA
>
>
> The manual says:
>
> http://docs.hp.com/cgi-bin/doc3k/B3150090013.11820/52
>
> Examples.
>
> For example, the following two records are allowed:
>
> 01 ROAD.
> 02 SURFACE OCCURS 1 TO 12 TIMES
> DEPENDING ON SIZER.
> 03 SIDE OCCURS 10 TIMES PIC X(9). Allowed.
>
> 01 ROAD.
> 02 SURFACE OCCURS 10 TIMES.
> 03 SIDE OCCURS 4 TIMES PIC X(9).
>
> But, the following two records are not allowed:
>
> 01 ROAD. Not allowed.
>
> 02 SURFACE OCCURS 10 TIMES.
> 03 SIDE OCCURS 1 TO 8 TIMES
> DEPENDING ON SIZER PIC X(9).
> 01 ROAD.
> 02 SURFACE OCCURS 1 TO 10 TIMES
> DEPENDING ON SIZER. Not allowed.
>
> 03 SIDE OCCURS 1 TO 8 TIMES
> DEPENDING ON SIZEUP PIC X(9).
>
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|