[Info-vax] COBOL, <gack!> again! Return status.
bill
bill.gunshannon at gmail.com
Tue Sep 12 09:00:32 EDT 2023
On 9/12/2023 8:44 AM, Jan-Erik Söderholm wrote:
> Den 2023-09-12 kl. 14:26, skrev bill:
>
>> I read the VA COBOL Reference and the VSI OpenVMS COBOL
>> Reference and it appears that VMS COBOL does not even
>> support RETURNING/GIVING in call statements...
>
> My copy of "VSI OpenVMS VSI COBOL Reference Guide" says
> on page 275, in the description of the CALL statement:
>
> 22.
> On Alpha and I64 systems, if the GIVING phrase of the CALL
> statement is not specified, the function result is made available
> in the RETURN-CODE special register when control returns to the
> calling program.
>
> 23.
> If the GIVING phrase is specified, the function result is made
> available in function-res when control returns to the calling program.
>
> [function-res]
> Is the identifier of an elementary integer numeric data item with COMP,
> COMP-1, or COMP-2 usage and no scaling positions. function-res can be
> subscripted, and it can be qualified. When control returns to the calling
> program, function-res can contain a function result.
>
>
>
> I would not expected that to be any different on x86...
Wow, I found and read that section. Seems to have been done as an
after thought. I guess the reason some compilers haven't included
it is because of the X/Open qualifier. :-) The explanation is even
more confusing than the one I finally found that made my last example
possible. In mine, the programmer has to put a value in RETURN-CODE
which then gets passed back to the RETURNING/GIVING identifier. The
VMS Reference seems to hint that it some how shows up in RETURN-CODE
automatically.
Could someone with the necessary compiler test my last example and
let me know if it works on VMS? Looks like setting up a VAX isn't
the answer. I wonder if the problems I had with the Alpha emulator
were ever fixed?
bill
More information about the Info-vax
mailing list