Creating an external link

An external link is a special type of symbolic link, a file that contains the name of an object outside of the z/OS UNIX file system. Using an external link, you associate that object with a path name. For example, setlocale() searches for locale object files in the z/OS UNIX file system, but if you want to keep your locale object files in a partitioned data set, you can create an external link in the file system that points to the PDS. This will improve performance by shortening the search made by setlocale().

A file can be an external link to a sequential data set, a PDS, or a PDS member. When a file is an external link to an MVS™ data set, an NFS client user can use the path name to access the data set. To use the path name to edit, browse, or display the attributes of the data set that is the target of an external link, you must be using the Network File System feature. Working in a shell, you can create (ln) an external link, display information (ls) about the link (not the target of the link), or delete (rm) the link.

These services support external links:
  • NFS client: You can create external links as files within the z/OS UNIX file system and then access these files as an NFS client user to access the MVS data sets that they point to.
  • A program using the exec() family of functions, the BPX1EXC (exec) callable service, the BPX1LOD (loadhfs) callable service, or the BPX1SPN (spawn) callable service can access an MVS data set using an external link. This capability includes external link programs that are invoked as commands in the shell.
  • Dynamic link libraries: The external link name used on a DLL load is a member name. For example, you would code a link as:
      ln -e IMWYWWS /usr/lpp/internet/bin/
    where IMWYW
    Figure 1. External link: A new file. An external link has an inode number. The MVS data set does not.
    A file system structure with an external link.
    WS is the member name that is linked to the file
To create an external link to a data set, use this command format:
ln -e old new
In Figure 1, /u/brooks/plib/pgm1 is the name of the new file that contains the reference to the partitioned data set BROOKS.PLIB.PGM1.
Limitations of an external link: z/OS UNIX C programs running cannot fopen() or fread() an external link. For more information, see the ln command description in z/OS UNIX System Services Command Reference.

Due to NFS protocol limitations, -e does not create an external link on NFS. For more information on creating an external link on NFS, see creating an external link in z/OS Network File System Guide and Reference.