[Info-vax] COBOL, <gack!> again! Return status.
Brian Schenkenberger
mail at SendSpamHere.ORG
Tue Sep 19 09:25:17 EDT 2023
On 2023-09-15 00:31:26 +0000, Stephen Hoffman said:
> On 2023-09-11 19:01:26 +0000, Brian Schenkenberger said:
>
>> 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.
>
> If it doesn't need to be portable COBOL, which seems likely given SYS$MGBLSC...
>
> CALL "SYS$EXIT" USING BY VALUE RETURN-STATUS
> And for errors...
>
> CALL "LIB$SIGNAL" USING BY VALUE ERROR-STATUS
Those would have stopped everything. I was writing a program in COBOL
for a customer which they could call to access data in a global
section. Sure, I could have witten it in a real language but I thought
I'd give them some "food for thought" and show them how to call VMS
system services and RTLs.
This exercise was something I hope I don't have to repeat. ;)
More information about the Info-vax
mailing list