Command reference / ifs

ADDLNK

Add Link

Creates another path to an existing IFS object. Choose a hard link to the object or a symbolic link that resolves its target by path.

Allowed environments: *ALL. Positional parameters: 3.

Parameters

OBJ Object

Sets the path name of the object the user wants to add a link to. This object must exist unless a symbolic link is to be added.

Type
*CHAR
Required
Yes
Length
5000
Case
Mixed case

NEWLNK New link

Sets the new path name that can be used to refer to the object. The new name must not exist.

Type
*CHAR
Required
Yes
Length
5000
Case
Mixed case

LNKTYPE Link type

Controls whether the link is hard or symbolic.

Type
*CHAR
Required
No
Default
*SYMBOLIC
Length
9
Case
Uppercase

Allowed values: *SYMBOLIC, *HARD

*SYMBOLIC
The link to the object is a representation of a path name. This representation is in the form of a path contained in a file.
*HARD
The link to the object is an actual path to an existing object. A hard link is established by creating a directory entry. Hard links cannot cross file systems.

Examples

ADDLNK OBJ('DECEMBER-1994-MONTHLY-PAYROLL-FILE') NEWLNK('PAY')

Adds a symbolic link named PAY to DECEMBER-1994-MONTHLY-PAYROLL-FILE.

ADDLNK OBJ('/QSYS.LIB/MYLIB.LIB/F1.FILE/P1.MBR') NEWLNK('PGM1') LNKTYPE(*SYMBOLIC)

Adds a symbolic link named PGM1 from the user's directory (not in QSYS.LIB, independent ASP QSYS.LIB, or QDLS) to member P1 in source file F1 in QSYS.LIB.

ADDLNK OBJ('/QOpenSys/MYDIR/FILE1') NEWLNK('FILE2') LNKTYPE(*HARD)

Adds a hard link from the user's current directory, with the name FILE2, to FILE1 in /QOpenSys/MYDIR.

IBM command documentation

Generated from os/cl/catalog/ADDLNK.json and os/cl/help/ADDLNK.json.