REQPROTO(*NO)

You can specify keyword REQPROTO(*NO) for the procedure interface of a cycle-main procedure to indicate that a prototype is not required even if the REQPREXP Control keyword or the REQPREXP command parameter indicate that warnings or errors should be issued if there is no prototype for an exported procedure.

Note: The procedure interface of a cycle-main procedure is a procedure interface that appears in the source code before the first DCL-PROC statement in free-form code or Procedure-Begin statement in fixed-form code. If the procedure interface has a name, and there is a prototype specified prior to the Procedure Interface with the same name, that prototype is considered to be a prototype for the cycle-main procedure.
*NO
When REQPROTO(*NO) is specified, no warning or error is issued if there is no prototype for the main procedure.

The REQPROTO keyword is not allowed on the procedure-interface for any procedure other than the cycle-main procedure. For other procedures, the REQPROTO keyword is specified on the first statement of the procedure. See REQPROTO(*NO).

Examples

  • In the following free-form example
    1. Control keyword REQPREXP(*REQUIRE) is specified.
    2. A procedure interface is specified without a name. It is impossible to have a prototype for the cycle-main procedure when the procedure interface does not have a name.
    3. An error message is issued in the compile listing. The error message states the following: "No prototype is specified for an external procedure or program, and REQPREXP(*REQUIRE) is specified."
    
    CTL-OPT REQPREXP(*REQUIRE); //  1 
    
    DCL-PI *N END-PI;           //  1 
    ===> Error:                 //  1 
    
  • In the following free-form example
    1. Control keyword REQPREXP(*REQUIRE) is specified.
    2. A procedure interface is specified without a name, but keyword REQPROTO(*NO) is specified.

      No error message is issued in the compile listing because keyword REQPROTO(*NO) indicates that a prototype is not required.

    
    CTL-OPT REQPREXP(*REQUIRE); //  1 
    
    DCL-PI *N REQPROTO(*NO) END-PI;  //  1 
    
  • In the following fixed-form example
    1. Control keyword REQPREXP(*WARN) is specified.
    2. A procedure interface is specified with a name. However, no prototype with that name is specified prior to the procedure-interface.
    3. A warning message is issued in the compile listing. The warning message states the following: "Warning: No prototype is specified for an external procedure or program."
    
    H REQPREXP(*WARN)         1 
    D MYPGM           PI      2 
    ===> Warning:             3 
    
    C                   RETURN
    
  • In the following fixed-form example
    1. Control keyword REQPREXP(*WARN) is specified.
    2. A procedure interface is specified with a name. However, no prototype with that name is specified prior to the procedure-interface.

      Keyword REQPROTO(*NO) is specified, indicating that no prototype is required.

    
    H REQPREXP(*WARN)         1 
    D MYPGM           PI     REQPROTO(*NO)   2 
    
    C                   RETURN