IRI Blog Articles

Diving Deeper into Data Management

 

 

Post image for Single Job Execution Options in IRI Workbench

Single Job Execution Options in IRI Workbench

by Susan Gegner

IRI Workbench not only has several ways to create jobs, but also several ways to execute them.

This article focuses on IRI Workbench execution options for scripts based on the SortCL program language, which covers IRI CoSort (transform/report), NextForm (migrate/replicate), FieldShield (classify/mask), and RowGen (test data) jobs. In addition to IRI Workbench execution, these jobs also run on the command line, in a batch script, or as a system call from an executable program.

Recall that IRI Workbench is the graphical IDE built on Eclipse that supports all IRI software products, and it creates their jobs: 1) manually in a syntax-aware script editor; 2) automatically through end-to-end wizards in the top toolbar menus; or, 3) graphically with the Voracity ETL flow design palette.

IRI Workbench also executes other types of jobs, including FACT .ini scripts, DB load utilities, Voracity ETL flow files, SQL procedures, batch programs, etc. I’ll cover the execution of Voracity flows (which serialize as batch scripts) in my next article.

Locate Your Job(s)

When created, these scripts are placed in the active project of the Project Explorer. SortCL job scripts are also created from the Transform Mapping Blocks in a Flow and placed in the active project. In addition, any SortCL script can be copied into a project and then executed.

Execution Option 1: Command Line

IRI jobs run on the command line using the below syntax. The executable for CoSort is sortcl, while the other SortCL language-compatible executables have the same name as the product:

sortcl /specification=CoSort_transform_or_reporting_job.scl
fieldshield /specification=data_masking_job.fcl
nextform /specification=conversion_or_replication_job.ncl
rowgen /specification=test_data_generation_job.rcl

The IRI job script can be moved to any computer where an IRI executable is installed. The script can be run from a command line or from within a batch process, and the same script can be executed on computers with Windows, Linux, and Unix operating systems. Therefore, it is possible to develop a script on your desktop, then move it to another computer for execution.

You can also invoke a shell user interface from within IRI Workbench to gain access to a command line prompt. This can be done using  ShelExec, Wicked Shell, or the Launch Shell feature in the Remote Systems Explorer. 

Execution Option 2: Run Menu

You can execute a valid job script by clicking on the white arrow in the green circle on the navigation bar. This is the Run menu item and will only execute after you first click on a script in a project, or you click in the body of a script in the editor. If you click the down arrow next to Run, a list of scripts that were previously run is shown. Click any script on that list to execute it. In addition to the list of scripts, you can also select Run As > IRI Job to run the active script.

Execution Option 3: Run As

Suppose we want to execute the script SortTransSelect.scl located in the project MonthEnd. To execute from the Project Explorer, right-click on the script name and click > Run As > IRI Job. Or, if the script is the active tab in the editor, right-click in the body of the script and click > Run As > IRI Job. Both  methods will execute a script and place results in the project.

Execution Option 4: Local Run Configurations

In each of the above cases, you can choose Run Configurations instead of IRI Job. Every time you execute a SortCL script, the information about the job is recorded on the Run Configurations window. In the box to the left under IRI job are the names for the jobs that have been previously defined or run.  Initially, the name of the job is the name of the SortCL job script. In this case, we select SortTransSelect.scl. If no jobs have been set up, or to set up a new job, right-click IRI Job and click New. New_configuration will be in the Name field and placed under IRI Job in the tree.

The Main Tab

In the screenshot below, we have MonthEnd in the Project field of the Main tab. The SortTransSelect.scl script is listed in the Job Execution Sequence box with the project name and path where the script is located. The IRI Executable field contains the path and name for the executable used with this job.  You can select a different executable from the drop-down or Browse to one.

Run Configurations

You can list multiple job scripts in the Job Execution Sequence box. Select Search/Add to bring up the Select SortCL job files window, which lists all the SortCL language scripts located in the project. The check box for SortTransSelect.scl is already selected. Now select the check box for join.scl and click OK. The two SortCL scripts are now listed in alphabetical order in the Job Execution Sequence box. The scripts will be executed in the order they are listed. Since we want join.scl to execute last, click it and select Down.

Select SortCL job files

Defining Environment Variables

In the job script SortTransSelect.scl, there is a line in the script like this one:

/QUERY="SELECT * FROM NIGHTLY.TRANSACTIONS WHERE PURCHASE_DATE >= \'\$STARTDATE\' AND PURCHASE_DATE < \$ENDDATE\'"

There are two environment variables: STARTDATE and ENDDATE. In the Environment Variables tab, you can define any that are used in the job scripts. Select New to specify each one. For the first, enter “STARTDATE” for Name and “161201” for Value. For the second, enter “ENDDATE” for Name and “170101” for Value. Both are then listed in the box for Environment variables to set. Make sure Append environment to native environment is selected.

New Environment Variable

Run Configurations-Environment Variables


Saving and Running the Job

Since we are executing two SortCL job scripts, we should rename the jobs (from Name) to something more appropriate. Change it to MonthendPart1 and click Apply. In the tree on the left, the name for IRI Job changes from SortTransSelect.scl to MonthEndPart1, and all the other changes made are saved.

Run Configurations-Main

Whenever you want to execute this job, access Run Configurations, click MonthEndPart1 in the tree, and click Run.

Execution Option 5: Remote Run Configurations

Jobs in projects on remote systems (see video) can also launch from your Run Configurations dialog in IRI Workbench. In this case, I have a remote project called Force5Project1 on a Linux server called Force5 which contains a SortCL job script called chiefs_sep.scl. Type Force5SortChiefs in the Name field.

The Main Tab

The Project field should have Force5Project1. The Job Execution Sequence box should have the path and name for the job script.

Select the Search/Add button, then select the check box for our script. Click OK to populate the Job Execution Sequence box.

The Remote Execution Tab

  1. Select the Remote Execution tab.
  2. Select the Remote check box and click the Browse button for Working Directory.
  3. In the Connection drop-down, select Force5.
  4. In the tree below, expand My Home and select the project for this job. Click OK.
  5. Connection now contains the connection name of Force5, Host contains the hostname of force5.iri.com, and Working Directory contains the full path to the job script.
  6. Next, Browse to the CoSort CLI Executable on the remote server and click OK.
  7. Click Apply to add the name to the IRI Job list and save the parameters for running the remote job.

Run Configurations-Remote Execution

Conclusion

There are multiple ways to execute an individual job script in the IRI Workbench, and there are several ways to access both Run and Run As for a particular script. In addition, the Run Configurations window offers a way to set up and save the parameters for both local and remote jobs, allowing repetition of the jobs to be consistent. Any messages associated with a job display in the Console view at runtime.

Print Friendly

{ 1 comment… read it below or add one }

Anonymous August 18, 2016 at 8:26 am

Do you have a flow chart (at a glance) summary of these options?

Reply

Leave a Comment

Previous post:

Next post: