ALIAS statement
The ALIAS statement specifies one or more additional names for the primary entry point, and can also specify names of alternate entry points.
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.
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.
- 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.
- The binder ALIAS control statement, or equivalent
binder API call, is used to specify an alias to a particular entry
point (target symbol) in the executable. However, for a module with
multiple text classes, all the entry points must be in the first class
of the first segment (PO3 or higher support multiple loadable text
classes). Beginning with V2R2, if a user sets an alias to a symbol
not in the first class of the first segment (perhaps unintentionally), Program
Management reports this situation as described in the following:
- For ALIAS A, if A matches the name of an external symbol, and that symbol is not in the first class of the first segment, the alias A is made a true alias (just as if there were no matching external symbol) and so is marked as EXECUTABLE, and Program Management issues the informational message IEW2619I.
- For ALIAS A(TARGET), if TARGET matches the name of an external symbol and that symbol is not in the first class of the first segment, the alias A is made a true alias (just as if there were no matching external symbol) and so is marked as NOT EXECUTABLE. The return code is minimally 4 and the warning message IEW2652 is issued.
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.
SYMPATH specification applies to all SYMLINK specifications that precede it, until the preceding SYMPATH specification (if any).
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.