Document Number:     J4/02-0251
2002-11-22 
 
DF-1.2           Page    1  of   3
Subject: 
Restricted program pointer with AS phrase on CALL stmt
Author: 
Artur Reimann, Thane Hubbell
Previous Version: 
02-0116 
http://www.cobolstandard.info/j4020116.htm
References:
1.
ISO/IEC FDIS 1989:2002, Programming language
COBOL:
Page 420, 14.8.4 CALL statement
02-0070  –Restricted program pointer with AS phrase on
CALL stmt (Schricker)
 
http://www.cobolstandard.info/j4020070.htm
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?
Document Number:     J4/02-0251
2002-11-22 
 
DF-1.2           Page    2  of   3
Note that
 
SET pp-1 TO ADDRESS OF PROGRAM program-2
is invalid according to the syntax rules of the SET statement unless the signatures of program-1
and program-2 are the same.  Therefore, it would seem that this AS phrase should not be allowed
on the CALL statement unless the two signatures are the same, and in that case there is no need
for the AS phrase.
General rule 7 of the CALL statement, which applies to the format 3 (the program-prototype for-
mat) 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 de-
termine 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:
 identifier-1
NESTED
AS
 literal-1
 program-prototype-name-1
 
CALL
 identifier-5
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.
Document Number:     J4/02-0251
2002-11-22 
 
DF-1.2           Page    3  of   3
Mr. Hubbell moved and Mr. Stevens seconded:  To approve the Proposed Response and
Changes Needed sections of 02-0116, and to request that Mr. Hubbell prepare an ISO-format
defect report based on this document,   Passed;  Yes – 7; No – 0; Abstain – 0.