Example: Using Automation Engine Variables in RA FTP Agent Jobs

The example below uses a variable that is set with either a prompt or For Each Workflow.

The following example assumes you have a basic knowledge of Automation Engine features.

In this example scenario, a variable is used in an RA FTP Agent Job:

  • To specify an FTP host.
  • In FTP commands.
When this FTP Job is: The value of the Variable is set by: Where a VARA object is assigned as the:

Executed individually

A prompt in a PromptSet object

Prompt's data reference, allowing you to select a host from a dynamic list.

Run in a For Each Workflow

The For Each Workflow properties

Source for the variable's value. When the Workflow runs, it spawns an instance of the RA FTP Agent Job for every host returned by the VARA object.

An RA FTP Agent Job named JOBS.FTPAGENT.GET_CARD_TRANSACTIONS_SELECT_REMOTE_HOST is shown below. The variable &CONNECTION# is entered as the From host. This means that when the Job is executed, the value for the From host will be determined by the value of the &CONNECTION# variable.

Example Using Variables for the From connection

The Job includes the three commands shown in detail the three images below. Each command also uses the &CONNECTION# variable.

Command with a variable

Command with a variable

Command with a variable

The &CONNECTION# variable is set each time the JOBS.FTPAGENT.GET_CARD_TRANSACTIONS_SELECT_REMOTE_HOST RA FTP Agent Job is executed by a prompt defined in a PromptSet object named PRPT.CONNECTION, which is assigned to the Job as shown below.

Prompt assignment

The PromptSet definition for PRPT.CONNECTION is shown below. Notice that the VARA object VARA.SQLI.CONNECTION_NAME is the data reference for PRPT.CONNECTION's only prompt.

Prompt definition

The VARA definition for VARA.SQLI.CONNECTION_NAME is shown below. It includes the following SQL statement.

select oh_name from oh where oh_otype='CONN' and oh_name like '%STORE%' and oh_name not like '%OLD%'

This SQL statement returns a list of hosts based on the naming convention STORE<number>.

Variable SQL

JOBS.FTPAGENT.GET_CARD_TRANSACTIONS_SELECT_REMOTE_HOST is included as the only task in the JOBP.FOREACH.REMOTE_HOST For Each Workflow below.

In the For Each details, VARA.SQLI.CONNECTION_NAME is specified as the variable in the Name field. And &CONNECTION# is set as the variable to publish values to.

When the JOBP.FOREACH.REMOTE_HOST Workflow is executed, it spawns an instance of the JOBS.FTPAGENT.GET_CARD_TRANSACTIONS_SELECT_REMOTE_HOST RA FTP Agent Job for every host returned by the VARA.SQLI.CONNECTION_NAME VARA object.

For Each workflow