Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

UNIX enhancements aren't.


devel / comp.lang.cobol / Re: Strange behaviour

SubjectAuthor
* Strange behaviourbill
+* Re: Strange behaviourArne Vajhøj
|`* Re: Strange behaviourbill
| +- Re: Strange behaviourArne Vajhøj
| `* Re: Strange behaviourArne Vajhøj
|  `* Re: Strange behaviourbill
|   `- Re: Strange behaviourAndrew
`- Re: Strange behaviourVincent Coen

1
Strange behaviour

<km4e6fF8emlU15@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=490&group=comp.lang.cobol#490

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gunshannon@gmail.com (bill)
Newsgroups: comp.lang.cobol
Subject: Strange behaviour
Date: Sat, 9 Sep 2023 19:42:06 -0400
Lines: 38
Message-ID: <km4e6fF8emlU15@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net ZKcmnKi2XXj1xg+3/BE3+QyfcYcwIJDPno75oFJ68UZWGLPMDq
Cancel-Lock: sha1:o1eR6zvmYU830ATgeyHd8/+NywM= sha256:RBB4+tp4ez87jtLXgmGFvN95T8osQwsAa7rGRs7uS+s=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Content-Language: en-US
 by: bill - Sat, 9 Sep 2023 23:42 UTC

So, I am n a discussion with someone regarding the use of "-" and "_"
in COBOL names. It started using VMS COBOL but moved to others. The
following was run under GnuCOBOL.

------------------------------------
C:\Work>type m2.cob
IDENTIFICATION DIVISION.
PROGRAM-ID.M2.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 I-V PIC 9(9) DISPLAY EXTERNAL.
PROCEDURE DIVISION.
MAIN-PARAGRAPH.
MOVE 123 TO I-V
CALL "R2"
STOP RUN.

C:\Work>type r2.cob
IDENTIFICATION DIVISION.
PROGRAM-ID.R2.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 I_V PIC 9(9) DISPLAY EXTERNAL.
PROCEDURE DIVISION.
MAIN-PARAGRAPH.
DISPLAY I_V.
END PROGRAM R2.

C:\Work>cobc -Wall -free -x m2.cob r2.cob

C:\Work>m2
000000123
----------------------------------------

Are "I-V" and "I_V" the same object? If so, where is this documented?

bill

Re: Strange behaviour

<udj5gn$94re$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=491&group=comp.lang.cobol#491

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.lang.cobol
Subject: Re: Strange behaviour
Date: Sat, 9 Sep 2023 21:18:16 -0400
Organization: A noiseless patient Spider
Lines: 71
Message-ID: <udj5gn$94re$2@dont-email.me>
References: <km4e6fF8emlU15@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 10 Sep 2023 01:18:15 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0f9033cb5133fb6f9c543d68b9b6edb1";
logging-data="299886"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UBtkUihnXGi0EZaARpd9Ac5tD2pZ5Xx0="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.0
Cancel-Lock: sha1:6RZQnUIL4BVePuUybBNTcMy7JJg=
In-Reply-To: <km4e6fF8emlU15@mid.individual.net>
Content-Language: en-US
 by: Arne Vajhøj - Sun, 10 Sep 2023 01:18 UTC

On 9/9/2023 7:42 PM, bill wrote:
> So, I am n a discussion with someone regarding the use of "-" and "_"
> in COBOL names.  It started using VMS COBOL but moved to others.  The
> following was run under GnuCOBOL.
>
> ------------------------------------
> C:\Work>type m2.cob
> IDENTIFICATION DIVISION.
> PROGRAM-ID.M2.
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 I-V  PIC 9(9) DISPLAY EXTERNAL.
> PROCEDURE DIVISION.
> MAIN-PARAGRAPH.
>     MOVE 123 TO I-V
>     CALL "R2"
>     STOP RUN.
>
> C:\Work>type r2.cob
> IDENTIFICATION DIVISION.
> PROGRAM-ID.R2.
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 I_V PIC 9(9) DISPLAY EXTERNAL.
> PROCEDURE DIVISION.
> MAIN-PARAGRAPH.
>     DISPLAY I_V.
>     END PROGRAM R2.
>
> C:\Work>cobc -Wall -free -x m2.cob r2.cob
>
> C:\Work>m2
> 000000123
> ----------------------------------------
>
> Are "I-V" and "I_V" the same object?  If so, where is this documented?

You could have asked in c.o.v..

:-)

https://sourceforge.net/projects/gnucobol/

<quote>
GnuCOBOL (formerly OpenCOBOL) is a free, modern COBOL compiler. GnuCOBOL
implements a substantial part of the COBOL 85, X/Open COBOL and newer
ISO COBOL standards (2002, 2014, 2023), as well as many extensions
included in other COBOL compilers (IBM COBOL, MicroFocus COBOL,
ACUCOBOL-GT and others).
</quote>

The important part is "X/Open COBOL".

https://pubs.opengroup.org/onlinepubs/009680799/toc.pdf

<quote>
8.10 EXTERNAL NAMES AND CASE CONVENTIONS
....
• working storage items having the EXTERNAL clause (lower-case letters,
digits and
hyphens; hyphens are converted to underscores)
</quote>

I have no idea about how widely implemented that rule is.

Arne

Re: Strange behaviour

<km5tk4F8emlU16@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=492&group=comp.lang.cobol#492

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gunshannon@gmail.com (bill)
Newsgroups: comp.lang.cobol
Subject: Re: Strange behaviour
Date: Sun, 10 Sep 2023 09:11:30 -0400
Lines: 76
Message-ID: <km5tk4F8emlU16@mid.individual.net>
References: <km4e6fF8emlU15@mid.individual.net> <udj5gn$94re$2@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net HMVMhTOdJ3WwjFAZXiTzoA/l+dmDzIAP9br2s+qp3J4BsAdPsC
Cancel-Lock: sha1:xTt1xa2kXx6c/NbISHMvHHY+Eo8= sha256:ou4z+GTTXhbttsgQBVWi9098W9hRHrKU5+nA0rmwCnw=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Content-Language: en-US
In-Reply-To: <udj5gn$94re$2@dont-email.me>
 by: bill - Sun, 10 Sep 2023 13:11 UTC

On 9/9/2023 9:18 PM, Arne Vajhøj wrote:
> On 9/9/2023 7:42 PM, bill wrote:
>> So, I am n a discussion with someone regarding the use of "-" and "_"
>> in COBOL names.  It started using VMS COBOL but moved to others.  The
>> following was run under GnuCOBOL.
>>
>> ------------------------------------
>> C:\Work>type m2.cob
>> IDENTIFICATION DIVISION.
>> PROGRAM-ID.M2.
>> DATA DIVISION.
>> WORKING-STORAGE SECTION.
>> 01 I-V  PIC 9(9) DISPLAY EXTERNAL.
>> PROCEDURE DIVISION.
>> MAIN-PARAGRAPH.
>>      MOVE 123 TO I-V
>>      CALL "R2"
>>      STOP RUN.
>>
>> C:\Work>type r2.cob
>> IDENTIFICATION DIVISION.
>> PROGRAM-ID.R2.
>> DATA DIVISION.
>> WORKING-STORAGE SECTION.
>> 01 I_V PIC 9(9) DISPLAY EXTERNAL.
>> PROCEDURE DIVISION.
>> MAIN-PARAGRAPH.
>>      DISPLAY I_V.
>>      END PROGRAM R2.
>>
>> C:\Work>cobc -Wall -free -x m2.cob r2.cob
>>
>> C:\Work>m2
>> 000000123
>> ----------------------------------------
>>
>> Are "I-V" and "I_V" the same object?  If so, where is this documented?
>
> You could have asked in c.o.v..
>
> :-)
>
> https://sourceforge.net/projects/gnucobol/
>
> <quote>
> GnuCOBOL (formerly OpenCOBOL) is a free, modern COBOL compiler. GnuCOBOL
> implements a substantial part of the COBOL 85, X/Open COBOL and newer
> ISO COBOL standards (2002, 2014, 2023), as well as many extensions
> included in other COBOL compilers (IBM COBOL, MicroFocus COBOL,
> ACUCOBOL-GT and others).
> </quote>
>
> The important part is "X/Open COBOL".
>
> https://pubs.opengroup.org/onlinepubs/009680799/toc.pdf
>
> <quote>
> 8.10 EXTERNAL NAMES AND CASE CONVENTIONS
> ...
> • working storage items having the EXTERNAL clause (lower-case letters,
> digits and
> hyphens; hyphens are converted to underscores)
> </quote>
>
> I have no idea about how widely implemented that rule is.
>

So let's see if I now understand this. A bunch of European
Unix System manufacturers decided to break the COBOL language
in a very bad way and everyone is jumping on the band wagon?

Let's hope the majority of serious COBOL programmers avoid this
like the plague.

bill

Re: Strange behaviour

<1694358304@f1.n250.z2.fidonet.ftn>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=493&group=comp.lang.cobol#493

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: VBCoen@gmail.com (Vincent Coen)
Newsgroups: comp.lang.cobol
Subject: Re: Strange behaviour
Date: Sun, 10 Sep 2023 16:05:04 +0100
Organization: A noiseless patient Spider
Lines: 73
Sender: "Vincent Coen" <VBCoen@gmail.com>
Message-ID: <1694358304@f1.n250.z2.fidonet.ftn>
References: <km4e6fF8emlU15@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="a7be41d572f513b282d387ee32ea4d2a";
logging-data="662167"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX186a92Eq2y/OBaAcivb1mfm"
Cancel-Lock: sha1:TSHZBJ/AL8/tm8sFhZoOj46k+6w=
X-FTN-Sender: Vincent Coen <Vincent.Coen@f1.n250.z2.fidonet.org>
X-FTN-AREA: COMP.LANG.COBOL
REPLY: mid.individual.net 536a16ef
X-FTN-CHRS: UTF-8 2
X-FTN-MSGID: 2:250/1@fidonet 64fdddaa
X-Origin-Newsgroups: comp.lang.cobol
X-FTN-TID: MBSE-FIDO 1.0.8.4 (Linux-x86_64)
X-FTN-PID: GED+LNX 1.1.5-b20180707
X-Comment-To: bill <bill.gunshannon@gmail.com>
X-FTN-SEEN-BY: 25/0 21 250/0 1 2 4 5 8 13 14 263/0 362/6 371/52 467/4 712/1321
X-FTN-PATH: 250/1
X-FTN-TZUTC: 0100
X-Newsreader: GoldED+/LNX 1.1.5 (Linux 5.15.122-server-1.mga8 CPU UNKNOWN)
 by: Vincent Coen - Sun, 10 Sep 2023 15:05 UTC

Hello bill!

Sunday September 10 2023 00:42, bill wrote to All:

> So, I am n a discussion with someone regarding the use of "-" and "_"
> in COBOL names. It started using VMS COBOL but moved to others. The
> following was run under GnuCOBOL.

> ------------------------------------
C:\Work>> type m2.cob
> IDENTIFICATION DIVISION.
> PROGRAM-ID.M2.
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 I-V PIC 9(9) DISPLAY EXTERNAL.
> PROCEDURE DIVISION.
> MAIN-PARAGRAPH.
> MOVE 123 TO I-V
> CALL "R2"
> STOP RUN.

C:\Work>> type r2.cob
> IDENTIFICATION DIVISION.
> PROGRAM-ID.R2.
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 I_V PIC 9(9) DISPLAY EXTERNAL.
> PROCEDURE DIVISION.
> MAIN-PARAGRAPH.
> DISPLAY I_V.
> END PROGRAM R2.

C:\Work>> cobc -Wall -free -x m2.cob r2.cob

C:\Work>> m2
> 000000123
> ----------------------------------------

> Are "I-V" and "I_V" the same object? If so, where is this documented?

They are different variables and what the C compiler sees them as is
immaterial to the Cobol programmer but what is important is that using an
underscore character it will get lost if you use a matrix or line printer
type and produced your listing to it (i.e., music paper etc).

Using underscore has been a no-no for many year (like 50+) for that reason
and for those that use other printers the underscore is easy to miss
whereas the hyphen is not.

But hey, I am old school programming in Cobol (and others) since 1963.

And yes I would love to get a working Matrix printer capable of 132 and 160
columns but the prices in the UK as 3 - 5 times more than in the 80's and
the quality less than half and 25% of the speed along with, in some cases
the same model was around in the 80's.

There are times, I do wish I had kept the two fast printers I had instead
of selling them off just because of small hardware faults.

If only for printing out program listings at least used during debugging.

A4 paper even landscape is not that easy to see and use! OK my eyes are not
as good as there were.

Mind you the matrix printers did take up a fair bit of space in my study /
computer room but nothing compared to a line printer but it would wake up
the houses each side of my terrace house when running :).

Vincent

Re: Strange behaviour

<udktpl$lc9m$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=494&group=comp.lang.cobol#494

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.lang.cobol
Subject: Re: Strange behaviour
Date: Sun, 10 Sep 2023 13:18:47 -0400
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <udktpl$lc9m$1@dont-email.me>
References: <km4e6fF8emlU15@mid.individual.net> <udj5gn$94re$2@dont-email.me>
<km5tk4F8emlU16@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 10 Sep 2023 17:18:45 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0f9033cb5133fb6f9c543d68b9b6edb1";
logging-data="700726"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sijVLiUi6cLdwvB1e5nxfKDTMd02Opug="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.0
Cancel-Lock: sha1:QiZcMwssYEz3P/Q0/9xh3G5fFKI=
In-Reply-To: <km5tk4F8emlU16@mid.individual.net>
Content-Language: en-US
 by: Arne Vajhøj - Sun, 10 Sep 2023 17:18 UTC

On 9/10/2023 9:11 AM, bill wrote:
> On 9/9/2023 9:18 PM, Arne Vajhøj wrote:
>> https://sourceforge.net/projects/gnucobol/
>>
>> <quote>
>> GnuCOBOL (formerly OpenCOBOL) is a free, modern COBOL compiler.
>> GnuCOBOL implements a substantial part of the COBOL 85, X/Open COBOL
>> and newer ISO COBOL standards (2002, 2014, 2023), as well as many
>> extensions included in other COBOL compilers (IBM COBOL, MicroFocus
>> COBOL, ACUCOBOL-GT and others).
>> </quote>
>>
>> The important part is "X/Open COBOL".
>>
>> https://pubs.opengroup.org/onlinepubs/009680799/toc.pdf
>>
>> <quote>
>> 8.10 EXTERNAL NAMES AND CASE CONVENTIONS
>> ...
>> • working storage items having the EXTERNAL clause (lower-case
>> letters, digits and
>> hyphens; hyphens are converted to underscores)
>> </quote>
>>
>> I have no idea about how widely implemented that rule is.
>>
>
> So let's see if I now understand this.  A bunch of European
> Unix System manufacturers decided to break the COBOL language
> in a very bad way and everyone is jumping on the band wagon?
>
> Let's hope the majority of serious COBOL programmers avoid this
> like the plague.

X/Open later Open Group was original created by Bull (France),
ICL (UK), Siemens (Germany), Olivetti (Italy) and Nixdorf
(Germany).

But at the time of publishing this doc they had been joined
by: Philips (Netherlands), Ericsson (Sweden), AT&T (US), Digital (US),
HP (US), Sun (US), Unisys (US), NCR (US), IBM (US), Prime (US),
Apollo (US), Fujitsu (Japan), Hitachi (Japan) and NEC (Japan).

And they do a lot of different stuff:
* Single Unix Specification
* CLI (the database meaning of that acronym)
* XA
* DCE
* Motif & CDE
* TOGAF

As a standardization organization I think they are much less
important than ISO and its national counterparts, and less
important than ECMA and OASIS.

Arne

Re: Strange behaviour

<udkuv4$lgd0$1@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=495&group=comp.lang.cobol#495

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: arne@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.lang.cobol
Subject: Re: Strange behaviour
Date: Sun, 10 Sep 2023 13:38:47 -0400
Organization: A noiseless patient Spider
Lines: 82
Message-ID: <udkuv4$lgd0$1@dont-email.me>
References: <km4e6fF8emlU15@mid.individual.net> <udj5gn$94re$2@dont-email.me>
<km5tk4F8emlU16@mid.individual.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 10 Sep 2023 17:38:44 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0f9033cb5133fb6f9c543d68b9b6edb1";
logging-data="704928"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/DrQoPXQX9VXmb0QgPvq5o6OPxqb+VfqE="
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.15.0
Cancel-Lock: sha1:LPHgvxy8plRJ/zJa+p7812dGoH4=
Content-Language: en-US
In-Reply-To: <km5tk4F8emlU16@mid.individual.net>
 by: Arne Vajhøj - Sun, 10 Sep 2023 17:38 UTC

On 9/10/2023 9:11 AM, bill wrote:
> On 9/9/2023 9:18 PM, Arne Vajhøj wrote:
>> https://sourceforge.net/projects/gnucobol/
>>
>> <quote>
>> GnuCOBOL (formerly OpenCOBOL) is a free, modern COBOL compiler.
>> GnuCOBOL implements a substantial part of the COBOL 85, X/Open COBOL
>> and newer ISO COBOL standards (2002, 2014, 2023), as well as many
>> extensions included in other COBOL compilers (IBM COBOL, MicroFocus
>> COBOL, ACUCOBOL-GT and others).
>> </quote>
>>
>> The important part is "X/Open COBOL".
>>
>> https://pubs.opengroup.org/onlinepubs/009680799/toc.pdf
>>
>> <quote>
>> 8.10 EXTERNAL NAMES AND CASE CONVENTIONS
>> ...
>> • working storage items having the EXTERNAL clause (lower-case
>> letters, digits and
>> hyphens; hyphens are converted to underscores)
>> </quote>
>>
>> I have no idea about how widely implemented that rule is.
>>
>
> So let's see if I now understand this.  A bunch of European
> Unix System manufacturers decided to break the COBOL language
> in a very bad way and everyone is jumping on the band wagon?
>
> Let's hope the majority of serious COBOL programmers avoid this
> like the plague.

I don't know why they did this.

But I could guess that it is because X/Open or Open Group
is very much focused on interoperability.

And names with hyphen are typical not supported in other
languages.

Back to VMS Cobol:

$ typ m3.cob
IDENTIFICATION DIVISION.
PROGRAM-ID.M3.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 I-V PIC 9(9) DISPLAY EXTERNAL.
PROCEDURE DIVISION.
MAIN-PARAGRAPH.
MOVE 123 TO I-V
CALL "R3"
STOP RUN.
$ typ r3.c
#include <stdio.h>
#include <string.h>

extern char i_v[9];

void r3()
{ char temp[10];
memcpy(temp, i_v, 9);
temp[9] = 0;
printf("%s\n", temp);
} $ cob m3
$ cc/extern=common r3
$ link m3 + r3
$ run m3
000000123

i-v is not a valid name in C but i_v is.

Anyway it is a rather weird feature. But let us not forget that
it only came up because Brian made a typo. :-)

Arne

Re: Strange behaviour

<km6i6mF8emlU17@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=496&group=comp.lang.cobol#496

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: bill.gunshannon@gmail.com (bill)
Newsgroups: comp.lang.cobol
Subject: Re: Strange behaviour
Date: Sun, 10 Sep 2023 15:02:45 -0400
Lines: 91
Message-ID: <km6i6mF8emlU17@mid.individual.net>
References: <km4e6fF8emlU15@mid.individual.net> <udj5gn$94re$2@dont-email.me>
<km5tk4F8emlU16@mid.individual.net> <udkuv4$lgd0$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net 64F/w6sOK8vzaPpRjmkOxAULJ578Xgbl5gFOkUZ/9RTlITiWt9
Cancel-Lock: sha1:wXoPclnr4HA/hcDMQfLubvfq/A4= sha256:YemO7c7Cgkc5j9qsRjvc9EE14eF3cVTEjLjU/S8EsPk=
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.14.0
Content-Language: en-US
In-Reply-To: <udkuv4$lgd0$1@dont-email.me>
 by: bill - Sun, 10 Sep 2023 19:02 UTC

On 9/10/2023 1:38 PM, Arne Vajhøj wrote:
> On 9/10/2023 9:11 AM, bill wrote:
>> On 9/9/2023 9:18 PM, Arne Vajhøj wrote:
>>> https://sourceforge.net/projects/gnucobol/
>>>
>>> <quote>
>>> GnuCOBOL (formerly OpenCOBOL) is a free, modern COBOL compiler.
>>> GnuCOBOL implements a substantial part of the COBOL 85, X/Open COBOL
>>> and newer ISO COBOL standards (2002, 2014, 2023), as well as many
>>> extensions included in other COBOL compilers (IBM COBOL, MicroFocus
>>> COBOL, ACUCOBOL-GT and others).
>>> </quote>
>>>
>>> The important part is "X/Open COBOL".
>>>
>>> https://pubs.opengroup.org/onlinepubs/009680799/toc.pdf
>>>
>>> <quote>
>>> 8.10 EXTERNAL NAMES AND CASE CONVENTIONS
>>> ...
>>> • working storage items having the EXTERNAL clause (lower-case
>>> letters, digits and
>>> hyphens; hyphens are converted to underscores)
>>> </quote>
>>>
>>> I have no idea about how widely implemented that rule is.
>>>
>>
>> So let's see if I now understand this.  A bunch of European
>> Unix System manufacturers decided to break the COBOL language
>> in a very bad way and everyone is jumping on the band wagon?
>>
>> Let's hope the majority of serious COBOL programmers avoid this
>> like the plague.
>
> I don't know why they did this.
>
> But I could guess that it is because X/Open or Open Group
> is very much focused on interoperability.
>
> And names with hyphen are typical not supported in other
> languages.

So what? Because C doesn't like it we should change COBOL?

>
> Back to VMS Cobol:
>
> $ typ m3.cob
> IDENTIFICATION DIVISION.
> PROGRAM-ID.M3.
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 I-V  PIC 9(9) DISPLAY EXTERNAL.
> PROCEDURE DIVISION.
> MAIN-PARAGRAPH.
>     MOVE 123 TO I-V
>     CALL "R3"
>     STOP RUN.
> $ typ r3.c
> #include <stdio.h>
> #include <string.h>
>
> extern char i_v[9];
>
> void r3()
> {
>     char temp[10];
>     memcpy(temp, i_v, 9);
>     temp[9] = 0;
>     printf("%s\n", temp);
> }
> $ cob m3
> $ cc/extern=common r3
> $ link m3 + r3
> $ run m3
> 000000123
>
> i-v is not a valid name in C but i_v is.

Again, so what? Why didn't they change C like they did COBOL?

>
> Anyway it is a rather weird feature. But let us not forget that
> it only came up because Brian made a typo.  :-)

Feature to some bug to others.

bill

Re: Strange behaviour

<ui5or5$i3v3$1@paganini.bofh.team>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=501&group=comp.lang.cobol#501

  copy link   Newsgroups: comp.lang.cobol
Path: i2pn2.org!i2pn.org!paganini.bofh.team!not-for-mail
From: Doug@hyperspace.vogon.gov (Andrew)
Newsgroups: comp.lang.cobol
Subject: Re: Strange behaviour
Date: Sat, 4 Nov 2023 16:43:32 +0100
Organization: To protect and to server
Message-ID: <ui5or5$i3v3$1@paganini.bofh.team>
References: <km4e6fF8emlU15@mid.individual.net> <udj5gn$94re$2@dont-email.me>
<km5tk4F8emlU16@mid.individual.net> <udkuv4$lgd0$1@dont-email.me>
<km6i6mF8emlU17@mid.individual.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 4 Nov 2023 15:43:33 -0000 (UTC)
Injection-Info: paganini.bofh.team; logging-data="593891"; posting-host="XBJBjenliTep7OIZ0g9xdw.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
SeaMonkey/2.53.17.1
Cancel-Lock: sha256:+s62W889QBg0loPnJQAd1NkuowcuBqNtu4b51OPbjLw=
X-Notice: Filtered by postfilter v. 0.9.3
 by: Andrew - Sat, 4 Nov 2023 15:43 UTC

bill wrote:
> On 9/10/2023 1:38 PM, Arne Vajhøj wrote:
>> On 9/10/2023 9:11 AM, bill wrote:
>>> On 9/9/2023 9:18 PM, Arne Vajhøj wrote:
>>>> https://sourceforge.net/projects/gnucobol/
>>>>
>>>> <quote>
>>>> GnuCOBOL (formerly OpenCOBOL) is a free, modern COBOL compiler.
>>>> GnuCOBOL implements a substantial part of the COBOL 85, X/Open COBOL
>>>> and newer ISO COBOL standards (2002, 2014, 2023), as well as many
>>>> extensions included in other COBOL compilers (IBM COBOL, MicroFocus
>>>> COBOL, ACUCOBOL-GT and others).
>>>> </quote>
>>>>
>>>> The important part is "X/Open COBOL".
>>>>
>>>> https://pubs.opengroup.org/onlinepubs/009680799/toc.pdf
>>>>
>>>> <quote>
>>>> 8.10 EXTERNAL NAMES AND CASE CONVENTIONS
>>>> ...
>>>> • working storage items having the EXTERNAL clause (lower-case
>>>> letters, digits and
>>>> hyphens; hyphens are converted to underscores)
>>>> </quote>
>>>>
>>>> I have no idea about how widely implemented that rule is.
>>>>
>>>
>>> So let's see if I now understand this.  A bunch of European
>>> Unix System manufacturers decided to break the COBOL language
>>> in a very bad way and everyone is jumping on the band wagon?
>>>
>>> Let's hope the majority of serious COBOL programmers avoid this
>>> like the plague.
>>
>> I don't know why they did this.
>>
>> But I could guess that it is because X/Open or Open Group
>> is very much focused on interoperability.
>>
>> And names with hyphen are typical not supported in other
>> languages.
>
> So what? Because C doesn't like it we should change COBOL?
>
>>
>> Back to VMS Cobol:
>>
>> $ typ m3.cob
>> IDENTIFICATION DIVISION.
>> PROGRAM-ID.M3.
>> DATA DIVISION.
>> WORKING-STORAGE SECTION.
>> 01 I-V  PIC 9(9) DISPLAY EXTERNAL.
>> PROCEDURE DIVISION.
>> MAIN-PARAGRAPH.
>>      MOVE 123 TO I-V
>>      CALL "R3"
>>      STOP RUN.
>> $ typ r3.c
>> #include <stdio.h>
>> #include <string.h>
>>
>> extern char i_v[9];
>>
>> void r3()
>> {
>>      char temp[10];
>>      memcpy(temp, i_v, 9);
>>      temp[9] = 0;
>>      printf("%s\n", temp);
>> }
>> $ cob m3
>> $ cc/extern=common r3
>> $ link m3 + r3
>> $ run m3
>> 000000123
>>
>> i-v is not a valid name in C but i_v is.
>
> Again, so what?  Why didn't they change C like they did COBOL?
>
>>
>> Anyway it is a rather weird feature. But let us not forget that
>> it only came up because Brian made a typo.  :-)
>
> Feature to some bug to others.
>
> bill
>
>

If I understand this correctly, the equivalencing of "-" and "_" only
happens with data items marked as EXTERNAL. The version of COBOL I used
to use did this differently,

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
I-O-CONTROL.
APPLY EXREF I-V. (meant that I-V could be accessed by name
from other programs).

APPLY EXDEF I-V. (meant that I-V was external to the program).

Some parts of the COBOL specs are "implementor defined" and the
limitations on the data-item names thus defined were in that category,
that meant that EXDEF/EXREF names were limited to 12 characters with one
compiler. I can't remember any restrictions on which characters could
be used, but folding "-" to "_" makes perfect sense if you are
communicating with any one of a number of other languages.
The alternative would have been to have defined the field (and the
names) in an assembler routine and to have made sure I-V and I_V
occupied the same storage location.
Sub-optimal.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor