Sunday 20 September 2015

Chapter 2: Working with JIL



Chapter 2: Working with JIL 


The jil Command and JIL (Job Information Language) 

Job Information Language (JIL) is a scripting language that lets you define and modify
assets such as jobs, global variables, machines, job types, external instances, and blobs.
The jil command runs the language processor that inteprets JIL. You use JIL
subcommands and attributes to specify the asset definitions that you want to create or
modify. The jil command loads the data that you specify into the database.
You can define and modify assets using the following methods:
■ Issue the jil command, which displays the JIL command prompt. You enter
subcommands interactively one line at a time. When you exit the command
prompt, the language processor interprets the asset definition and loads it into the
database.
■ Create a JIL script by entering subcommands and attribute statements in a text file.
You redirect the JIL script to the jil command. The jil command activates the
language processor, interprets the information in the script, and loads this
information in the database.

JIL Subcommands 


JIL subcommands lets you define and modify asset definitions. You specify JIL 
subcommands using the jil command. 

The following JIL subcommands define and modify jobs and boxes: 

delete_box 
Deletes an existing box job and all the jobs in that box from the database. 
delete_job 
Deletes a job from the database. If the specified job is a box job, the box job is 
deleted and the jobs in the box become stand-alone jobs. 
insert_job 
Adds a new job definition to the database. 
override_job 
Defines a one-time override for an existing job definition. This override affects the 
job for the next run only. 
update_job 
Updates an existing job definition in the database. 
The following JIL subcommands define and modify machines: 


delete_machine 
Deletes an existing real or virtual machine definition from the database. 
insert_machine 
Inserts a new real or virtual machine definition in the database. A machine must be 
defined before it can be used in a job definition. 
update_machine 
Updates an existing machine in the database. 
The following JIL subcommands define and modify monitor or report definitions: 
delete_monbro 
Deletes the specified monitor or report definition from the database. 
insert_monbro 
Adds a new monitor or report definition to the database. 
update_monbro 
Updates an existing monitor or report definition in the database. 

The following JIL subcommands define and modify job types: 

delete_job_type 
Verifies that no jobs are currently defined with the specified job type, then deletes 
the specified job type definition from the database. 
insert_job_type 
Adds a new user-defined job type definition to the database. This is the only way to 
create a user-defined job type. 
update_job_type 
Updates an existing user-defined job type definition in the database. You can use 
update_job_type to change the values of the command and description attributes. 
The following JIL subcommands define and modify blobs and globs: 
insert_blob 
Adds a new blob definition associated with an existing job. 
insert_glob 
Adds a new glob definition referenced by a given name. 
delete_blob 
Decouples a blob definition from an existing job and deletes the blob from the 
database. 
delete_glob 
Deletes the specified glob definition from the database. 
The following JIL subcommands define and modify external instances: 
delete_xinst 
Deletes the specified external instance definition from the database. 
insert_xinst 
Adds a new external instance definition to the database. 
update_xinst 
Updates an existing external instance definition in the database. 
The following JIL subcommands define and modify resources: 
delete_resource 
Deletes a virtual resource from the database. 
insert_resource 
Adds a new virtual resource definition to the database. 
update_resource 
Updates an existing virtual resource definition in the database. 



JIL Syntax Rules 

JIL scripts contain one or more JIL subcommands and one or more attribute statements. 
These elements constitute a job definition. You can create job definitions in interactive 
mode by opening the operating system or instance command prompt and entering the 
following command: 

jil 

Alternatively, you can enter the subcommands and attribute statements for all of your 
job definitions in a text (.txt) file and then import the job definitions by redirecting the 
file as input to JIL. To import job definitions from a text file, open the operating system 
or instance command prompt and enter the following command: 

jil < file_name.txt 

 A JIL script is valid only when it is written according to the JIL syntax rules. If you create 
the job definitions in a text file import them, ensure that you follow the JIL syntax rules. 
To automatically check the syntax, enter the following command: 

jil -v syntax < file_name.txt 

Important! The syntax checker does not commit the job definitions in the file to the 
database. To commit the definitions, ensure that you correct any syntax errors that the 
checker identifies and then run the following command: 

jil < file_name.txt 

Note: Running the syntax checker adds time to the import process. 
A valid job definition adheres to the following syntax rules: 

Rule 1 
Each subcommand uses the following form: 

sub_command:object_name 
sub_command 

Defines a JIL subcommand. 
object_name 

Defines the name of the object (for example, a job or a machine) to act on. 
Rule 2 
You can follow each subcommand with one or more attribute statements. These 
statements can occur in any order and are applied to the object specified in the 
preceding subcommand. A subsequent subcommand begins a new set of attributes 
for a different object. The attribute statements have the following form: 
attribute_keyword:value 
attribute_keyword 
Defines a valid JIL attribute. 
value 
Defines the setting to apply to the attribute. 
Notes: 
■ The entire attribute_keyword:value statement can be up to 4096 characters. 
■ The following subcommands do not accept attributes: delete_box, delete_job, 
delete_job_type, delete_xinst, delete_monbro, and delete_glob. 
Rule 3 
You can enter multiple attribute statements on the same line, but you must 
separate the attribute statements with at least one space. 
Rule 4 
A box job definition must exist before you can add jobs to it. 
Rule 5 
Valid value settings can include any of the following characters: 
■ Uppercase and lowercase letters (A-Z, a-z) 
■ Hyphens (-) 
■ Underscores (_) 
■ Pound signs (#) 
■ Numbers (0-9) 
■ Colons (:), if the colon is escaped with quotation marks (" ") or a preceding 
backslash (\) 
■ The at character (@) 
Note: Object names can only contain the following characters: a-z, A-Z, 0-9, period 
(.), underscore (_), hyphen (-), and pound (#). Do not include embedded spaces or 
tabs. 
Rule 6 
Because JIL parses on the combination of a keyword followed by a colon, you must 
use escape characters (a backslash) or enclose the value in quotation marks with 
any colons used in an attribute statement's value. For example, to define the start 
time for a job, specify 10\:00or “10:00”. 
Note: When specifying drive letters in commands, you must use escape characters 
with the colon (:). For example, "C:\tmp" and C\:\tmp are valid; C:\tmp is not. 
Rule 7 
Use one of the following methods to indicate comments in a JIL script: 
■ To comment an entire line, put a pound sign (#) in the first column. 
■ To comment one or more lines, you can use the C programming syntax for 
beginning a comment with a forward slash and asterisk (/*) and ending it with 
an asterisk and a forward slash (*/). For example: 
 /* this is a comment */ 
Rule 8 
You can use the blob_input attribute to manually enter multiline text. This attribute 
is only valid for the insert_job, update_job, insert_blob, and insert_glob 
subcommands. The blob_input attribute has the following form: 
blob_input:<auto_blobt> this is a multi- 
line text 
</auto_blobt> 
Note: Use the auto_blobt meta-tags to indicate the beginning and end of multiline 
text. JIL interprets every character input between the auto_blobt meta-tags 
literally. This implies that JIL does not enforce any of the previously discussed rules 
for text entered in an open auto_blobt meta-tag. 
Rule 9 
To specify a comma in keyword=value combinations, you must do one of the 
following: 
■ Escape the comma with a backslash, as follows: 
j2ee_parameter: String=Hello1\, World 
■ Enclose the entire value in quotation marks, as follows: 
j2ee_parameter: String="Hello1, World" 
If the keyword=value combination contains commas and quotation marks, you must 
escape the commas and quotation marks as follows: 
j2ee_parameter: String=\"Hello1\, World\"

Issue JIL in Interactive Mode on UNIX 

You can issue the jil command and subcommands on UNIX at the operating system 
prompt. The operating system prompt lets you enter data interactively. You can also 
create aliases for the commands that you use frequently. The interactive mode is helpful 
when you do not need to issue JIL commands in batch. For example, you can use the 
interactive mode when you want to test specific job definitions. 
Note: Before you can issue commands at the operating system prompt, the CA 
Workload Automation AE environment must be sourced in the shell and your UNIX user 
ID and password must be defined on CA Workload Automation AE. For more 
information about sourcing the environment and defining user IDs, see the UNIX 
Implementation Guide. 
Follow these steps: 
1. Run the shell that is sourced to use CA Workload Automation AE. 
2. Do one of the following: 
■ Enter jil at the operating system prompt. 
The JIL command prompt is displayed for the local CA Workload Automation AE 
instance. 
■ Enter jil -S instance at the operating system prompt. 
The JIL command prompt is displayed for the specified CA Workload 
Automation AE instance. 
instance 
Specifies the CA Workload Automation AE instance where you want to issue 
the JIL subcommand. For single-instance environments, the jil command 
defaults to the only available instance. 
3. Enter a JIL subcommand and follow the prompts. 
4. Enter exit when you are done entering the data. 
JIL interactive mode ends and the data is loaded into the database. 
Issue JIL in Interactive Mode on Windows 

You can issue the jil command and subcommands on Windows by using the CA 
Workload Automation AE instance command prompt. The instance command prompt 
lets you enter data interactively. The interactive mode is helpful when you do not need 
to issue JIL commands in batch. For example, you can use the interactive mode when 
you want to test specific job definitions. 

Follow these steps: 

1. Click Start, Programs, CA, Workload Automation AE, Command Prompt 
(instance_name). 
The instance command prompt is displayed. 
2. Do one of the following: 
■ Enter jil. 
The JIL command prompt is displayed for the local CA Workload Automation AE 
instance. 
■ Enter jil -S instance. 
The JIL command prompt is displayed for the specified CA Workload 
Automation AE instance. 
instance 
Specifies the CA Workload Automation AE instance where you want to issue 
the JIL subcommand. For single-instance environments, the jil command 
defaults to the only available instance. 
3. Enter a JIL subcommand and follow the prompts. 
4. Enter exit when you are done entering the data. 
JIL interactive mode ends and the data is loaded into the database. 

Issue JIL Using a Script on UNIX 
You can embed JIL subcommands and attribute statements in a shell script and redirect 
the script to the jil command. The jil command activates the language processor, 
interprets the information in the script, and loads this information in the database. 
Using a script is helpful when you want to issue JIL subcommands in batch. 
Note: Before you can run the JIL script, the CA Workload Automation AE environment 
must be sourced in the shell and your UNIX user ID and password must be defined on CA 
Workload Automation AE. For more information about sourcing the environment and 
defining user IDs, see the UNIX Implementation Guide. 
Follow these steps: 
1. Run the shell that is sourced to use CA Workload Automation AE. 
2. Do one of the following: 
■ Enter jil < script at the operating system prompt. 
The subcommands in the JIL script are issued on the local CA Workload 
Automation AE instance and the data is loaded into the database. 
■ Enter jil -S instance < script at the operating system prompt. 
The subcommands in the JIL script are issued on the specified CA Workload 
Automation AE instance and the data is loaded into the database. 
script 
Specifies the name of the script that contains the JIL subcommands and 
attributes. 
instance 
Specifies the CA Workload Automation AE instance where you want to run the 
JIL script. For single-instance environments, the jil command defaults to the 
only available instance. 
Note: For more information about the jil command, see the Reference Guide. 
Example: Submit a Job Definition Using a JIL Script 
This example redirects a file called my_jil_script to the jil command on the PRD instance 
of CA Workload Automation AE. 
jil –S PRD < my_jil_script 

Issue JIL Using a Script on Windows 
You can embed JIL subcommands and attribute statements in a script and redirect the 
script to the jil command. The jil command activates the language processor, interprets 
the information in the script, and loads this information in the database. Using a script is 
helpful when you want to issue JIL subcommands in batch. 
Follow these steps: 
1. Click Start, Programs, CA, Workload Automation AE, Command Prompt 
(instance_name). 
The instance command prompt is displayed. 
2. Do one of the following: 
■ Enter jil < script. 
The subcommands in the JIL script are issued on the local CA Workload 
Automation AE instance and the data is loaded into the database. 
■ Enter jil -S instance < script. 
The subcommands in the JIL script are issued on the local CA Workload 
Automation AE instance and the data is loaded into the database. 
script 
Specifies the name of the script that contains the JIL subcommands and 
attributes. 
instance 
Specifies the CA Workload Automation AE instance where you want to run the 
JIL script. For single-instance environments, the jil command defaults to the 
only available instance. 
Notes: 
■ You cannot use the MS-DOS command prompt to redirect a JIL script to the jil 
command. 
■ To issue commands that run on a UNIX computer from Windows, you must use the 
syntax appropriate to the operating system where the job runs. 
■ For the jil command to work properly, the correct environment variables must be 
assigned. For more information about environment variables, see the Windows 
Implementation Guide. 
■ For more information about the jil command.

Example: Submit a Job Definition to the Local Instance Using a JIL Script 

This example redirects a file called newjobdef to the jil command on the local instance 
of CA Workload Automation AE. 
jil < newjobdef

Example JIL Script :

The following JIL script creates a command job, a file watcher job, and a box job to do 
the following: 
1. You expect a file named /DOWNLOAD/MAINFRAME/SALE.RAW to arrive from the 
mainframe some time after 2:00 a.m. 
2. When the file arrives, the command file named filter_mainframe_info processes it, 
and the results are sent as an output to the file named 
/DOWNLOAD/MAINFRAME/SALES.SQL. 
3. When the actions are complete, the SQL commands in the file named 
/DOWNLOAD/MAINFRAME/SALES.SQL runs. 
# Example of a Machine 
insert_machine: lowgate 
type: a 
# Example of Jobs 
insert_job: Nightly_Download 
job_type: box 
date_conditions: yes 
days_of_week: all 
start_times: "02:00" 
insert_job: Watch_4_file 
job_type: ft 
box_name: Nightly_Download 
watch_file: /DOWNLOAD/MAINFRAME/SALES.RAW 
watch_file_type: generate 
machine: lowgate 
insert_job: filter_data 
job_type: cmd 
box_name: Nightly_Download 
condition: success(Watch_4_file) 
command: filter_mainframe_info 
machine: lowgate 
std_in_file: /DOWNLOAD/MAINFRAME/SALES.RAW
insert_job: parse_data 
job_type: cmd 
box_name: Nightly_Download 
condition: success(filter_data) 
machine: lowgate 
command: isql -U mutt -P jeff 
std_in_file: /DOWNLOAD/MAINFRAME/SALES.SQL 
std_out_file: /LOG/parse_data.out 
std_err_file: /LOG/LOG/parse_data.err 


No comments:

Post a Comment