Given this bit of free-form code
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-TABLE.
05 WS-A PIC A(10)
OCCURS 1 TO 5 TIMES
DEPENDING ON D1
INDEXED BY I1.
01 D1 USAGE BINARY-CHAR UNSIGNED.
PROCEDURE DIVISION.
initialize ws-table.
set i1 to 10.
move i1 to d1.
move "thing" to WS-A(i1).
DISPLAY "ONE-D TABLE : "WS-TABLE.
STOP RUN.
This runs without error. Is that what's supposed to happen?
Given this bit of free-form code
IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-TABLE.
05 WS-A PIC A(10)
OCCURS 1 TO 5 TIMES
DEPENDING ON D1
INDEXED BY I1.
01 D1 USAGE BINARY-CHAR UNSIGNED.
PROCEDURE DIVISION.
initialize ws-table.
set i1 to 10.
move i1 to d1.
move "thing" to WS-A(i1).
DISPLAY "ONE-D TABLE : "WS-TABLE.
STOP RUN.
This runs without error. Is that what's supposed to happen?
The GnuCOBOL version is
cobc (GnuCOBOL) 3.2-dev.0
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html> This is free software; see the
source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by
Keisuke Nishida, Roger While, Ron Norman, Simon Sobisch, Edward
Hart Built Jul 07 2022 09:17:27 Packaged Jul 07 2022 08:40:44 UTC
C version (MinGW) "9.2.0"
Why are you expecting it to produce an error ?I suppose because many other languages do. I was not aware of the compiler switch and didn't find it after a couple of searches (maybe I didn't search for the right keyword).
On Thursday, 22 June 2023 at 2:14:35 am UTC+8, Vincent Coen wrote:Up until version 6.1, the IBM COBOL compiler and runtime environment were very sloppy in allowing this sort of thing. Then in 6.1 when they put in checks for such things, all kinds of issues were found in existing code. The migration to 6.1 is quite a
Why are you expecting it to produce an error ?I suppose because many other languages do. I was not aware of the compiler switch and didn't find it after a couple of searches (maybe I didn't search for the right keyword).
The fact that it doesn't produce an error means I just have to be more careful (or find the relevant switch).
-Bruce
On Friday, June 23, 2023 at 9:29:21???PM UTC-5, Bruce Axtens wrote:
On Thursday, 22 June 2023 at 2:14:35???am UTC+8, Vincent Coen wrote:compiler switch and didn't find it after a couple of searches (maybe I
Why are you expecting it to produce an error ?I suppose because many other languages do. I was not aware of the
didn't search for the right keyword).
Up until version 6.1, the IBM COBOL compiler and runtime environment
The fact that it doesn't produce an error means I just have to be more >careful (or find the relevant switch).
-Bruce
were very sloppy in allowing this sort of thing. Then in 6.1 when they
put in checks for such things, all kinds of issues were found in
existing code. The migration to 6.1 is quite a big deal for many shops.
On Friday, June 23, 2023 at 9:29:21 PM UTC-5, Bruce Axtens wrote:
On Thursday, 22 June 2023 at 2:14:35 am UTC+8, Vincent CoenUp until version 6.1, the IBM COBOL compiler and runtime environment
wrote:
Why are you expecting it to produce an error ?I suppose because many other languages do. I was not aware of the
compiler switch and didn't find it after a couple of searches (maybe
I didn't search for the right keyword). The fact that it doesn't
produce an error means I just have to be more careful (or find the
relevant switch). -Bruce
were very sloppy in allowing this sort of thing. Then in 6.1 when they
put in checks for such things, all kinds of issues were found in
existing code. The migration to 6.1 is quite a big deal for many
shops.
Hello William!
Thursday July 06 2023 19:49, William Fahle wrote to All:
On Friday, June 23, 2023 at 9:29:21???PM UTC-5, Bruce Axtens wrote:
On Thursday, 22 June 2023 at 2:14:35???am UTC+8, Vincent CoenUp until version 6.1, the IBM COBOL compiler and runtime environment
wrote:
Why are you expecting it to produce an error ?I suppose because many other languages do. I was not aware of the
compiler switch and didn't find it after a couple of searches (maybe
I didn't search for the right keyword). The fact that it doesn't
produce an error means I just have to be more careful (or find the
relevant switch). -Bruce
were very sloppy in allowing this sort of thing. Then in 6.1 when they
put in checks for such things, all kinds of issues were found in
existing code. The migration to 6.1 is quite a big deal for many
shops.
IBM compilers have always had a diag check facility on way or another BUT
it does depend on what settings are preset when the compiler was built for >the site.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 300 |
Nodes: | 16 (2 / 14) |
Uptime: | 106:28:41 |
Calls: | 6,700 |
Files: | 12,232 |
Messages: | 5,350,363 |