[Info-vax] COBOL example $MGBLSC

bill bill.gunshannon at gmail.com
Sat Sep 9 14:38:52 EDT 2023


On 9/9/2023 1:16 PM, Arne Vajhøj wrote:
> On 9/9/2023 12:47 PM, bill wrote:
>> On 9/9/2023 12:15 PM, Arne Vajhøj wrote:
>>> On 9/9/2023 11:36 AM, bill wrote:
>>>> On 9/9/2023 10:26 AM, Arne Vajhøj wrote:
>>>>> On 9/9/2023 10:20 AM, Jan-Erik Söderholm wrote:
>>>>>> Den 2023-09-09 kl. 16:02, skrev Dave Froble:
>>>>>>> On 9/9/2023 9:29 AM, Jan-Erik Söderholm wrote:
>>>>>>>> "Throughout this manual, and except where specific rules apply, the
>>>>>>>> hyphen (-) and the underline (_) are treated as the same character
>>>>>>>> in a user-defined word."
>>>>>>>
>>>>>>> I guess that could be compared to "case insensitive", but while I 
>>>>>>> consider case sensitivity to be less than reasonable, I find the 
>>>>>>> above to be really stupid. Sure makes searching for specific 
>>>>>>> words in a program complex.
>>>>>>>
>>>>>>> Got to understand Bill's objection to such.
>>>>>>
>>>>>> Stupid or not, it was not known to Bill and created that
>>>>>> wrong comment of being two differnt symbols. I just showed
>>>>>> that they are probably handled as the same symbol.
>>>>>>
>>>>>> That doesn't mean that I disagree with you... :-)
>>>>>
>>>>> Old languages sometimes has some rules that appears
>>>>> very weird, because the expectation today is determined
>>>>> by how a hundred newer languages has agreed on doing things
>>>>> a different way.
>>>>>
>>>>> Take as an example this perfectly valid Fortran 77 program:
>>>>>
>>>>>        program weird
>>>>>        integer*4 abc
>>>>>        abc = 123
>>>>>        write(*,*) abc
>>>>>        write(*,*) a b c
>>>>>        write(*,*) a     b     c
>>>>>        end
>>>>>
>>>>> WTF??
>>>>
>>>> As an old school Fortran programmer as well as COBOL (Fortran was my
>>>> second language other than various assemblers) all I see in this is
>>>> that you don't understand Fortran.  That is a perfectly valid, not
>>>> weird at all, program.  If you wanted it to treat "a", "b" and "c"
>>>> as separate and distinct variables you should have used commas as the
>>>> the language expects.  Spaces in that context are meaningless.  :-)
>>>
>>> Today it is considered weird that you can insert arbitrary
>>> spaces in variable names.
>>>
>>
>> That is all about parsing and really has nothing to do with the
>> function of the language.
> 
> True.
> 
> But treating - as _ in Cobol (in some contexts) is also just parsing
> and not function.

Not really the same.  The space is not considered a valid character
within a name in any language that I know of.  In COBOL the "-" and
"_" are considered valid characters for use in names and should
therefore be considered different.
Cases where different characters are considered
equivalent exist and are covered in the documentation. That is upper
and lower case letters are considered equivalent.  No other characters
are considered equivalent in any compiler I have worked with except
the VMS compiler.  I would love to see a pointer to any other compiler
that allows this.

bill





More information about the Info-vax mailing list