🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #399

Re: Two Cobol Questions

#399
From: Julia Rodriguez
Date: Sat, 05 Aug 1989 00:11
71 lines
3455 bytes
 norvell@csri.toronto.edu (Theodore Stevens Norvell) writes:
> 
> (0)  Some languages (notably Pascal) allow non-local gotos.  That is, gotos
>      that jump out of the current procedure.  Does Cobol? If so what is
>      its semantics?  For example does the following control structure have
>      a well defined semantics when foo is true?

There are two rules that apply here:
1) If the range of a PERFORM statement includes another PERFORM statement,
the sequence of procedures associated with the included PERFORM must itself
either be totally included in, or totally excluded from, the logical sequence 
referred to by the first PERFORM.  The example you give below violates this
rule.  The result of the operation is therefore undefined, as the program
is illegal.  

2) The range of a PERFORM statement consists logicallof all those statments 
that are executed as a result of executing the PERFORM statement through execution of implicit transfer of control to the end of the PERFORM statement. The
range includes all statement that are executed as the result of transfer of 
control by CALL, EXIT, GO TO and PERFORM statements in the range of the PERFORM
statement.

> 
>      a
> 	 perform b through c.
> 	 stop run.
>      b
> 	 perform d through e.
>      c
> 	 exit.
>      d
> 	 if foo then goto c.
>      e
> 	 exit.
> 
>      
>      By the way, I'm not interested so much in responses like
>      ``Compiler x does y'', but rather ``Standard x mandates y'' or
>      ``Standard x prohibits constructs like this because of rule y''.
>      Of course de-facto standards are also of interest.
> 
> (1)  Is there a ``Harbison and Steele'' of Cobol.  That is, a book that
>      thoroughly explains what is and isn't in the language.  (Harbison
>      and Steele wrote an excellent book on C aimed at implementors and
>      other people who want to know the details of the language definition.
>      They don't shy away from the dark corners of the language.)  The
>      books I've seen get the most vauge, just when clarity is needed the
>      most.
> 
The last word on COBOL is the ANSI and ISO standard which are one and the
same.  The ANSI number is ANSI X3.23-1985 and the ISO number is ISO 1989-1985.
The standard is published by the American National Standards Institute.

The X3J4 COBOL committee is and ANSI accredited committee.  Its tasks are to
interpret the current standard and to develop new standards.  I represent 
HP on the X3J4 committee.  If you have questions re how to interpret the
rules of the standard. Write to the X3J4 care of CBEMA.  

     X3 Secretariat
     CBEMA
     311 First Street, NW
     Suite 500
     Washington, DC 20001-2178

COBOL Information Bulletins are published periodically.  They contain the
collection of all the interpretations of the standard since the last
published CIB.  I believe that you can order these from CBEMA as well.


Hope this helps,
Julia Rodriguez
Technical Details
Message-ID: <960019@hpcll17.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!usc!apple!motcsd!hpda!hpcuhb!hpcllla!hpclisp!hpcll17!juliar
References: <1989Jul25.145219.22172@jarvis.csri.toronto.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!usc!apple!motcsd!hpda!hpcuhb!hpcllla!hpclisp!hpcll17!juliar
From: juliar@hpcll17.HP.COM (Julia Rodriguez)
Newsgroups: comp.lang.misc
Subject: Re: Two Cobol Questions
Message-ID: <960019@hpcll17.HP.COM>
Date: 5 Aug 89 00:11:10 GMT
References: <1989Jul25.145219.22172@jarvis.csri.toronto.edu>
Organization: Hewlett-Packard Calif. Language Lab
Lines: 71