Defines templates for a routine contained within a subroutine
package.
Format
DEFINE ROUTINE routine-name [parameter, . . . ]
1 – Qualifiers
1.1 /DESCRIPTION
/DESCRIPTION=string
Specifies a single line of text to be displayed along with the
routine name when the routine name appears in a menu during an
EXPAND operation. The string is also passed to the /ROUTINE_
EXPAND procedure, if any. (The default algorithm for producing
routine calls from DEFINE ROUTINE commands does not make use of
this value.)
1.2 /PACKAGE
/PACKAGE=package_name
Specifies the name of the package with which the routine is
associated. You must specify this qualifier.
1.3 /TOPIC_STRING
/TOPIC_STRING=string
Specifies a quoted string that LSE uses to retrieve help text for
this routine.
2 – Parameters
routine-name
Specifies the name of the routine. Routine names must be unique
within a package. Furthermore, routine names may not conflict with
any token names used by LSE for any language using the package.
parameter, . . .
Specifies the names of the parameters of the routine. These
parameters must be defined (using the DEFINE PARAMETER command)
prior to expanding an instance of a call on this routine. However,
the parameters do not need to be defined prior to the DEFINE
ROUTINE command. If you omit this qualifier, then the routine
is presumed to have no parameters.
The following qualifiers are position-sensitive; they may be used
only with the list of parameters to the routine.
/BY_VALUE
Indicates that the parameter is passed by value.
/BY_REFERENCE
Indicates that the parameter is passed by address.
/BY_DESCRIPTOR
Indicates that the address of the parameter descriptor is passed.
/[NO]OPTIONAL
Specifies whether the parameter is required or optional. The
default is /NOOPTIONAL.
The /BY_VALUE, /BY_REFERENCE, and /BY_DESCRIPTOR qualifiers are
mutually exclusive. These qualifiers are used primarily for
languages, such as COBOL, that require explicit specification
of passing mechanisms for routine calls.