Recently I thought of an old trick in PL/I concerning parameter transfer. My first thought was that the trick must be documented in the manuals, but I could not find any description of it. The PL/I language reference is far away from being easy to read and use, but I suspect the trick is described somewhere. My next step was to try it. And it still works just as I remembered it.
And here is what the trick is all about:
The result of executing the above piece of code looks like this:
The first call to APROC looks quite ordinary and A is as expected changed to the value X by APROC. After the second call A has not been changed. By putting a CALL parameter in parenthesis, PL/I creates a so-called dummy argument and the value of the parameter is transferred instead of the address of the parameter. If you are familiar with COBOL you will notice that putting a parameter in paranthesis is the same as writing BY VALUE after a parameter in a COBOL CALL.