HP3000-L Archives

December 2003, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Erik Vistica <[log in to unmask]>
Reply To:
Erik Vistica <[log in to unmask]>
Date:
Mon, 1 Dec 2003 17:48:24 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (61 lines)
 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 *

ATOM RSS1 RSS2