Hi,
I have a PL/I routine for processing (formatting & writing) messages. It takes a variable number of arguments via the "LIST" attribute on the last declared argument.
This allows me to use VARGLIST() and VARGSIZE() builtin functions to step through the optional parameters. This all works.
Now I am trying to call this from a COBOL program, but once I added the OPTIONS(COBOL) I get compiler errors telling me that the LINKAGE is incompatible with the "LIST" attribute.
Normally, when I run into restrictions it's easy to figure out why they exist (and sometimes get past them).
This one has me stumped. I know that COBOL does not directly support variable length parameter list, but it also does not prohibit them.
From COBOL, you can call an external entry point any number of times, passing a different number of arguments each time. It's up to the called program to correctly handle the variadic data.
Why is LIST (variadic parameters) prohibited for COBOL linkage in PL/I?
Is there another way to accomplish this?
Frank
Frank_O_Myers@IBM