[Info-vax] COBOL, <gack!> again! Return status.

bill bill.gunshannon at gmail.com
Thu Sep 14 18:32:37 EDT 2023


On 9/11/2023 3:45 PM, bill wrote:
> On 9/11/2023 3:01 PM, Brian Schenkenberger wrote:
>> How does a COBOL program return a status (ie. R0) to a calling 
>> program? I found a reference to RETURN-CODE but compiler balks at that.
>>
> 
> In Unix ending the program with:
> 
>      STOP RUN RETURNING {literal-1}
>                         {identifier-1}
> 
> 
> will make a return code available to the shell.
> 
> If you want a status returned to DCL I expect that would do it.
> 
> bill
> 
> {I really need to get a VMS system running here again.}
> 

OK, in case anyone is still interested in any of this.

OpenVMS COBOL does not support the RETURNING clause on a STOP RUN.

If you wish to pass a STATUS back to DCL you have to put the
desired value in the predefined variable RETURN-CODE before
using STOP RUN.

I tried it and it works fine.

I really miss doing COBOL.  Kinda miss Fortran, too, but not
as much.  And then there was Pascal.  A shame we lost all the
good languages.

bill




More information about the Info-vax mailing list