gnucobol-users
[Top][All Lists]
Advanced

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

RE: [open-cobol-list] a program that doesn't compile


From: William M. Klein
Subject: RE: [open-cobol-list] a program that doesn't compile
Date: Tue Feb 10 10:23:01 2004

Just to confirm, the ANSI and ISO '85 Standard *requires* that it be valid
to use any arithmetic expression as either the starting position or the
length in reference modification. 

NOTE: The '85 Standard does *not* allow an arithmetic expression as a
subscript, but the 2002 Standard does.  The '85 Standard *does* allow
"relative" subscripting with "+" or "-" but this is NOT an arithmetic
expression.

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On 
> Behalf Of David Korn
> Sent: Tuesday, February 10, 2004 10:04 AM
> To: address@hidden; address@hidden
> Subject: [open-cobol-list] a program that doesn't compile
> 
> cc: address@hidden 
> Subject: a program that doesn't compile
> --------
> 
> The followng program compiles with the IBM MVS Cobol compiler 
> but gives
> 
>       prog5.cob:17: parse error, unexpected '('
> 
> with open cobol.
> 
> ==========================prog5.cob========================
>        IDENTIFICATION DIVISION.
>        PROGRAM-ID.     PROG5.
>        ENVIRONMENT DIVISION.
>        INPUT-OUTPUT SECTION.
>        DATA DIVISION.
>        WORKING-STORAGE SECTION.
>        01  Q385-HIER-STRUC-ARRAY-REQREC.
>            03  Q385-TBL-REQST-CD           PIC X(8)    VALUE SPACES.
>            03  Q385-HIER-STRUC-ARRAY-ROW.
>                06  Q385-HIER-PRORD-KEY     PIC X(80)   VALUE SPACES.
> 
>                06  Q385-RELTV-HIER-LVL-NBR PIC S9(2)     COMP-3
>                                                        VALUE ZEROES.
>                06  Q385-PRNT-HP-PRORD-KEY  PIC X(80)   VALUE SPACES.
>        PROCEDURE DIVISION.
>        MOVE LOW-VALUES TO 
>            Q385-PRNT-HP-PRORD-KEY((Q385-RELTV-HIER-LVL-NBR * 2) - 1:2)
> ==========================end prog5.cob========================
> 
> David Korn
> address@hidden
> 
> 
> -------------------------------------------------------
> The SF.Net email is sponsored by EclipseCon 2004
> Premiere Conference on Open Tools Development and Integration
> See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
> http://www.eclipsecon.org/osdn
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
> https://lists.sourceforge.net/lists/listinfo/open-cobol-list
> 




reply via email to

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