Document Number:     J4/02-0069
March 8, 2002
Page    1
of   2

Subject:
Author:

Interpretation Request - Restricted program pointer with AS phrase on CALL stmt
Don Schricker
References:
1.
Base Document:  December 2001
QUESTION:
Is the AS phrase allowed to override a restricted program pointer?  There is no rule that prohibits it.
Consider, for example:
Should this CALL statement be legal?
Note that
SET pp-1 TO program-2 is invalid because of conformance
so, it would seem that such an AS phrase should not be allowed.

General rule 7 of the CALL statement, which applies to the format 3 (the program-prototype format)
reads:

7) If the NESTED phrase is not specified, program-prototype-name-1, or the program prototype specified
in the definition of identifier-1 if it is defined as a restricted program-pointer, is used to determine the
characteristics of the called program.

This implies that specifying program-prototype-name-1 and specifying a restricted program-pointer for
identifier-1 are mutually exclusive.  Taken literally, it means that program-prototype-name-1 is ignored if

identifer-1 is a restricted program-pointer.  Why require program-prototype-name-1 to be specified if it is
to be ignored?  This seems like an error.

There are a couple of solutions that come to mind:
Solution 1 – New syntax
change the syntax diagram for format 3 of the CALL statement so that the first line reads:
Document Number:     J4/02-0069
March 8, 2002
Page    2
of   2
 identifier-1

NESTED
 program-prototype-name-1

AS

 literal-1
 identifier-5

CALL
update the syntax rules so that

- identifier-5 is required to be a restricted program-pointer
- if identifier-1 is a program-pointer, it is not a restricted program-pointer.

Solution 2 – no change to the syntax, new syntax rule

Add a syntax rule so that when identifer-1 is a restricted program-pointer, it must be restricted to
program-prototype-name-1.  This seems very ugly.  There's no reason to specify the program prototype

when one has no choice as to what it is.
Summary

If we do nothing, either typing for program-pointers is broken or the user is required to specify syntax
that is ignored.  Implementations may differ in their interpretation.

I favor solution 1.