Link

PURPOSE:  The LINK command provides easy access from ACCENT R to other programs.  It provides the option to return to ACCENT R from other programs.  The LINK command thus allows applications to be developed using ACCENT R and to execute programs written in languages such as FORTRAN and COBOL.  You can also LINK out and call ACCENT R to execute a command, CM or PM.

You may also LINK out of ACCENT R to execute a DCL command or a set of DCL commands.

Syntax

LINK /TO/ program_name

[WITH list]

[/AND/ RETURN]

program_name

is the name of a saved executable process such as a COBOL or FORTRAN program, a DCL command, or even a utility program in the system library; for example, a file with the extension .EXE, .SHR, .HGH, or .SAV.  The extension .EXE is assumed, if not specified as part of program name.

WITH list

is a series of data objects separated by commas in the same manner as a TYPE or PRINT list.  Literals, constants, System Field names, System Functions, expressions, and picture formats may be used.  The list internally evaluates to a string that is used by WITH.  An automatic carriage return is added at the end of the list unless suppressed with a NOCR.

"WITH" places the evaluated list into the terminal’s input buffer so that when the linked program does input from the primary input device (usually the terminal) it first receives the characters of the WITH clause.

/AND/ RETURN

specifies that the linked program is to be run as a subprocess to ACCENT R; when the linked program finishes its execution, ACCENT R will be in the same state it was in just prior to the execution of the LINK command.  The /AND/ RETURN clause is required for use of LINK as a statement in a PM.

EXAMPLE

*LINK TO DCL WITH "$DIR", @CR, "$LOGO" AND RETURN

The following ACCENT R command transfers control to and begins execution of the program named MAKE_INVOICES:

*LINK MAKE_INVOICES

NOTES:  The options facilitate inter-program and application task control.  The WITH clause permits convenient passing of commands and/or control statements to the linked program; and the RETURN clause passes control back to ACCENT R with an intact environment.  LINK can be used as a Process Module statement with one difference: the /AND/ RETURN clause is required in a PM.