The ALIAS statement specifies one or more additional names for
the primary entry point, and can also specify names of alternate entry
points.
Note: Alternate entry points are not supported for program objects
that reside in z/OS UNIX files.
If a z/OS UNIX path
name is specified, that name becomes a true alias of the primary entry
point.
The binder does not place a limit on the number of alias names
that can be specified on an ALIAS statement or on separate ALIAS statements
for one library member. These names are entered in the directory of
the partitioned data set or PDSE in addition to the member name. If
the symbol specified as the alias has appeared on an earlier ALIAS
control statement, the new specification replaces the earlier one.
Note: If the module contains multiple text classes, all entry points
must be defined in the same class.
The syntax of the ALIAS statement is:
ALIAS {directoryname[(externalsymbol)]}
{(SYMLINK, pathname)}
{(SYMPATH, pathname)}
[,...]
- directoryname
- Specifies an alternate name for the program object or load module.
The symbol might or might not be the name of an external entry point
within the program.
When the program is executed using the alias
name, execution begins at the entry point associated with the alias.
The entry point is determined according to the following rules:
- If an externalsymbol is specified as an entry
point (see below) for the alias, execution begins at that entry point.
- If the alias symbol matches an entry name within the program,
execution begins at that entry point.
- If the alias symbol does not match an entry name within the program,
execution begins at the main entry point.
- externalsymbol
- Specifies the name of the entry point to be used when the program
is executed using the associated alias. If the external symbol is
the name of an entry point within the program, that name is used as
the entry point for the alias. If the external symbol is not an entry
point name, but another external name such as a pseudoregister or
an unresolved external reference, the main entry point is used as
the entry point for the alias. If the symbol you specify is not defined
in the program, the alias is not created.
- SYMLINK
- A symbolic link is a z/OS UNIX file that
contains the pathname for another file or directory. Symbolic links
can be links across mounted file systems.
- SYMPATH
- The contents of the path designated by a SYMLINK request are specified
by the next following SYMPATH request.
- pathname
- The pathname to or contained by a symbolic link. The pathname
contained in a symbolic link can be relative or absolute. If a symbolic
link contains a relative pathname, the pathname is relative to the
directory containing the symbolic link.
These entries can be repeated in any order. Alias entries can be
divided up among separate ALIAS statements as desired except that
there must be at least one SYMPATH specification following a given
SYMLINK or group of SYMLINKs.
Placement: An ALIAS statement can be placed before, between,
or after object modules or other control statements. It must precede
a NAME statement used to specify the member name, if one is present.
Note: - In an overlay program, an external name specified by the ALIAS
statement must be in the root segment. In a multitext class program
object, an alternate entry point specified by an ALIAS statement must
be defined in the same class as the primary entry point.
- When a program module in an MVS™ data set is reprocessed, all ALIAS statements
should be respecified so that the directory is updated. Otherwise,
for replaced load modules, the aliases remain in the directory and
point to the old library member. When a program object is replaced,
the aliases are deleted.
When a program module in a z/OS® UNIX file
is reprocessed, the existing aliases will be retained, whether or
not the existing aliases are respecified on ALIAS control statements.
- Each alias name that is specified must be unique within the library.
If the specified alias name matches an existing member name within
the library, the alias will be rejected. If the specified alias name
matches an existing alias name in the library and the replace option (R) was
not specified, the alias will be rejected. If replace was specified,
the new alias name will replace the existing one.
- To avoid name conflicts, delete obsolete alias names from the
program library directory.
- You can execute a program object that resides in a z/OS UNIX file by specifying
an alias name. However, execution will always begin at the main entry
point. By using the binder call interface, it is possible to copy
the program module and its aliases to a partitioned data set or a
PDSE. The alias information that was saved in the program object
will be used to create aliases for the copied module as either true
aliases or alternate entry points, in accordance with the rules documented
here.
Symbolic link support
The SYMLINK and SYMPATH functions of the ALIAS control statement
can be used to establish an arbitrary number of symbolic links. The
contents of the path designated by a SYMLINK request are specified
by the next following SYMPATH request. The result of a SYMLINK/SYMPATH
pair is the creation of a file whose:
- pathname is the SYMLINK path concatenated to the SYSLMOD path
- file type is 'symbolic link'
- contents are given by SYMPATH.
A SYMPATH specification applies to all SYMLINK specifications that
precede it, back to the first previous SYMPATH.
Thus, in the following skeleton example:
ALIAS (SYMLINK,A1)
ALIAS (SYMLINK,A2)
ALIAS (SYMPATH,B1)
ALIAS (SYMLINK,A3)
ALIAS (SYMLINK,A4)
ALIAS (SYMLINK,A5)
ALIAS (SYMPATH,B2)
ALIAS (SYMLINK,A6)
SYMPATH B1 is used for A1 and A2, SYMPATH B2 is used for A3 through
A5, and A6 is in error. Continuation rules and general syntactical
rules are the same as those for other Binder control statements and
control statement operands. Length limits for both the control statement
and ADDA API call are 1024 for both SYMLINK and SYMPATH.
If the GID or UID options are specified, the UID and GID values
for SYSLMOD are also used for the symbolic links.