Chain Directives

Introduction

Chain Directives icon
Use Chain Directives to create jobs that execute a list of jobs, either in series or in parallel.
You can nest Chain Directives jobs. One Chain Directives job can include and execute other Chain Directives jobs. A serial Chain Directives job can contain nested parallel jobs. Parallel jobs can contain nested serial jobs.
A Chain Directives job can contain multiple stances of a component job.
When you run your Chain Directives job, you can view the results of the component jobs in the chain, as the results become available.
You can run Chain Directive jobs by opening them in the Chain Directives interface, or you can run them from the Run Statuspage or the Saved Directivespage.

Example

To create and run your own Chain Directives job, open the directive in SAS Data Loader for Hadoop, and then follow through this example.

Specify Serial or Parallel

In the Chain task, under Chain directive type, click Serial or Parallel. Choose Serial when one job in the chain depends on the results of a preceding job. Choose Parallel to run a group of independent jobs simultaneously.
You can change your selection of Serial or Parallel at any point in the process of developing your chain directive.
Chain Directive, Chain Task

Select Directives

To select directives for your Chain Directives job, first locate a directive in Available directives. You can search, filter, and rearrange Available directives as follows:
  • To locate a directive by name, click and enter text in Find a directive.
  • To filter the list in order to display only single, serial, or parallel directives, click the Show field and select a value.
  • To rearrange the list from last-modified to first-modified, click Last modified.
To add a directive to your job, click the row in Available directives and then click the right arrow right single arrow with plus sign. Use Ctrl+click to select multiple directives.
To remove a directive from your job, select the directive in Selected directives and click trash can icon. Clicking the trash can icon removes the directive from Selected directives list. The directive is not deleted from the file system. Nor is it deleted from Saved Directives or Run Status.
In serial chain directives, to rearrange the order of the selected jobs, click the jobs in the list and click the vertical arrows. The top job runs first and the bottom job runs last.
Note: For parallel Chain Directives jobs, ensure that the component directives access source and target tables without conflict. Simultaneous Read access is supported. Simultaneous Write access of individual target tables is not supported. Also, one directive cannot write a target table while another job is reading that same table as a data source. To ensure accurate reads and writes in a parallel chain directive, open the directives as needed to ensure that target tables are unique. Also ensure that a target table in one directive is not used as a source in another directive.
If you choose Serial, the default behavior stops the execution of the chain directive if one of the directives in the chain fails to reach completion. To continue the execution of directives regardless of failures, click If a directive in the chain fails, and then select Continue to run the remaining directives.
To learn about available or selected directives, click the directive and read the description in Description of selected directive. To learn more, click More information. At the top of the More Information window, the Type row indicates that the selected directive is either Single (not a chain directive), Serial, or Parallel.
Chain Directives, More Information Window, shows a serial directive
The table at the bottom of the More Information window describes the contents of the selected directive. If the selected directive is a chain directive, the window lists all of the component directives. The Order column displays None for a single directive. The value is Concurrent for the components of a parallel chain directive. For a serial chain directive, the value specifies the execution order of the component directives.
When your directives have been selected and ordered, click Next to display the Result task.

Result

In the Result task, click Start running chained directives. As the job runs, you can examine the generated code and the SAS log file.
When the job is complete, click View Results and click a directive to view the results that were generated by that directive. The resulting target table is displayed in the Table Viewer, in a new browser tab.
Chain Directives, Result Task
Click Save to make your directive available in Saved Directives.