OPENLINK
Open a link file and set up a link relationship.

Format
Openlink MASTERDB(LINKFLD) for DETDB as TAG-NAME
MASTERDB(LINKFLD)Master database link field. Can also be a field expression (i.e. MASTERDB(#expr)).
DETDBDetail database.
TAG-NAMEName tag to use for this link file within the program. This name does not have to be the same as the name of the link field.
NOTE
The OPENLINK, GETLINK, LINK and DELINK statements are available to support UserBase format datafiles. If you are using RMS datafiles, you should not need to use these statements. Use the RMS key structure instead.

Qualifiers
/Fail=LABELLabel to which to branch if the statement fails.
If LABEL is %EXIT, exit the routine or loop.
If in a loop, and LABEL is %CONTINUE, continue the loop. If not in a loop, and LABEL is %CONTINUE, an error message displays.
 /Succeed=LABELLabel to which to branch if the statement succeeds.
If LABEL is %EXIT, exit the routine or loop. If in a loop, and LABEL is %CONTINUE, continue the loop. If not in a loop, and LABEL is %CONTINUE, an error message displays.
 /NofailDo not signal an error. Instead, set the
internal variable %FAIL.
 /WriteAllow write access (adding and deleting links).

Example
 Openlink EMPLOYEES(LINK)for HOURS as HOURSLINK /Write
 ! Open th Link file with write access
 Openlink EMPLOYEE(#"LINK" & n) for DEDUCTION as DLINK