Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

ENTRY attribute

The ENTRY attribute specifies that the name being declared is either an external entry constant, or an entry variable. It also describes the attributes of the parameters of the entry point.

Read syntax diagramSkip visual syntax diagram>>-ENTRY--+---------------------------------------+------------><
          |   .-,-----------------------------.   |
          |   V                               |   |
          '-(---+-| parameter-descr |-------+-+-)-'
                '-| structure-union-descr |-'
 
parameter-descr:
 
     .-----------.
     V           |
|--+---attribute-+------------------------+---------------------|
   '-*-+-+-----------+-----+-+----------+-'
       | +-ALIGNED---+     | '-OPTIONAL-'
       | '-UNALIGNED-'     |
       +-+---------------+-+
       | +-ASSIGNABLE----+ |
       | '-NONASSIGNABLE-' |
       +-+--------------+--+
       | +-CONNECTED----+  |
       | '-NONCONNECTED-'  |
       | .-BYADDR------.   |
       '-+-------------+---'
         '-+---------+-'
           '-BYVALUE-'
 
structure-union-descr:
 
      .---------------.
      V               |
|--1----+-----------+-+--+----------+--,------------------------>
        '-attribute-'    '-OPTIONAL-'
 
   .---------------------.
   V                     |
>----level-+-----------+-+--------------------------------------|
           '-attribute-'
 
ENTRY
The ENTRY attribute, without a parameter descriptor list, is implied by the RETURNS attribute.
parameter-descr (parameter-descriptor)
A parameter descriptor list can be given to describe the attributes of the parameters of the associated external entry constant or entry variable. It is used for argument and parameter attribute matching and the creation of dummy arguments.

If no parameter descriptor list is given, the default is for the argument attributes to match the parameter attributes. Thus, the parameter descriptor list must be supplied if argument attributes do not match the parameter attributes.

Each parameter descriptor corresponds to one parameter of the entry point invoked and, if given, specifies the attributes of that parameter.

The parameter descriptors must appear in the same order as the parameters they describe. If a descriptor is absent, the default is for the argument to match the parameter.

If a descriptor for a parameter is not required, the absence of the descriptor must be indicated by an asterisk. For example:

entry(character(10),*,*,fixed dec)
Indicates four arguments.
entry(*)
Indicates one argument.
entry( )
Specifies that the entry name must never have any arguments.
entry
Specifies that it can have any number of arguments.
entry(float binary,*)
Indicates two arguments.
attribute
The allowed attributes are any of the data attributes listed under Data attributes. The attributes can appear in any order in a parameter descriptor. For an array parameter-descriptor, the dimension attribute must be the first one specified.
*
An asterisk specifies that, for that parameter, any data type is allowed. The only attributes which are valid following the asterisk are: No conversions are done.
OPTIONAL
This attribute is discussed in OPTIONAL attribute.
structure-union-descr (structure-union-descriptor)
For a structure-union descriptor, the descriptor level-numbers need not be the same as those of the parameter, but the structuring must be identical. The attributes for a particular level can appear in any order.

Defaults are not applied if an asterisk is specified. For example, in the following declaration defaults are applied only for the second parameter.

  dcl X entry(* optional, aligned); /* defaults applied for 2nd parm */

Extents (lengths, sizes, and bounds) in parameter descriptors must be specified as constants or as asterisks. Controlled parameters must have asterisks.

RETURNS attribute implies the ENTRY attribute. For example:

Example parameter descriptors Declarations for example descriptors
   
  Test:  procedure (A,B,C,D,E,F);

 
   declare A fixed decimal (5),
           B float binary (21),
           C pointer,
           1 D,
             2 P,
             2 Q,
               3 R fixed decimal,
           1 E,
             2 X,
             2 Y,
               3 Z,
           F(4) character (10);
   end Test;
  declare Test entry
              (decimal fixed (5),
              binary float (21),
            *,
             1,
              2,
              2,
               3 decimal fixed,
              *,
             (4) char(10));

In the previous example, the parameter C, and the structure parameter E do not have descriptors.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)