Using the LinkTo Feature in Enterprise Guide
Enterprise Guide allows for the creation of complex process flows; however in some cases the order in which the tasks execute may not be appropriate. Below is a simple example to illustrate the issue:
The Assign Library task must execute first to make the input tables available within the SAS secssion; however as this task is positioned below the join in the process flow, the join will execute first. The result is that the join fails with errors.
To resolve this problem the linkto feature can be used to manually add links to a process flow where they have not been automatically added. Links can be made between any objects in the process flow except the generated outputs. Links are added by linking from one object to another. This is achieved by right clicking on the object to be linked from and selecting linkto. In this case it appears as Link Assign Library to...
A dialog box is opened displaying a selection of objects from the process flow; selecting one of these will add the link. Links formed in this way are displayed with a dashed line in the process flow. Now that the library task is linked to one of the tables it will execute first before the tables are processed.
A similar issue occurs when a program (code in EG4.1) node is added. In the example below a program node reads a table that has been output by the query task.
When added to the process flow Enterprise Guide does not detect that this node reads a table from the process flow and so no link is added. This causes two problems: there is no visual representation of the link between the input table and the program node and, as before, there is no explicit control over the order of execution and so the program node may execute before the input table has been created.
Luckily this issue can also be resolved by linking the input table to the program node. This means that process flows can be created using a combination of the drag and drop simplicity of the task based model and the infinite versatility of the programming language.
Another useful application of this technique is to link notes in as part of a process flow. This provides a convenient way to add documentation to a process flow. Notes can be added as part of the flow or just attached to specific nodes as required.
This tip has demonstrated the how simple functionality of the linkto option provides a versatile way to structure and control process flows within Enterprise Guide.