We use AutoSys for job scheduling, and I find myself writing a lot of JIL (job instruction language) scripts to delete boxes and re-insert them due to small job changes (e.g. start time, etc.). Is there an update command that can be used? CA's AutoSys cheat sheet has no information on one.
7 Answers
Yes,
It is the update_job: attribute.
Example to change the box BOX_A start time to 15:00 from 14:00
update_job: BOX_A
start_times: "15:00"
Save this into a file and run it using jil < filename.jil
-
The key point is to save this in a file and then use jil < filename.jil – Jack Kada Nov 04 '14 at 16:30
-
Alternatively you can just type jil in a unix prompt and then type out your autosys job command – Jack Kada Nov 04 '14 at 16:30
One thing which you might need to consider while entering your commands directly from jil CLI, That exit has to be written after finishing your commands.Otherwise it might not take effect. This happend with me few days ago.
So,If it happend that you entered the commands in JIL and it didnt take effect , try writing exit at the end of the prompt.Something like :
jil>> update_job: xyz <Enter>
jil>>1>start_times: 11:00 <Enter>
jil>>2>exit <Enter>

- 51
- 1
- 6
You can use the UPDATE_JOB. Take note that if you use this and your update is to remove the start_times (instead of just updating it), what you are going to do with your update_job jil is to still include the start_times entry but specify no value. See sample below:
update_job: BOX_A
start_times:
The foregoing will remove the start_times of the job. If you just remove the start_times in your update jil, the start_times will not be updated and it will still remain in the jil.

- 123
- 2
- 11
Guys if you are interested you can create an autosys job to update another job. The below output can be placed in a jil file to create a autosys job that when started will remove sa from a job that runs 7 days a week. I have many database job that occasionally during need not to run during a build weekend ie on saturday.
-------------This goes in the jil file-------------------
/* ----------------- update_job_date ----------------- */
insert_job: update_job_date job_type: c
box_name: update_job_attributes
command: echo "update_job\: runs_every_day job_type\: c days_of_week\: mo,tu,we,th,fr,su" | jil
machine: localhost
owner: root@localhost
permission: gx,wx
condition: d(job1)
description: "change date for update_job_date"
std_out_file: "$TEMP_PATH/$AUTO_JOB_NAME.log"
std_err_file: "$TEMP_PATH/$AUTO_JOB_NAME.log"
alarm_if_fail: 1
profile: /home/variables_autosys
-------------This goes in the jil file-------------------

- 1
- 1
I understand what the update does and that you can update many other attributes. The above example doesn't require you to create a jil file to perform the update.
My example above is for a scenario whereby a user needs to do this for mainteneance adhoc. So in that instance they create a maintenance box with the jobs in it that may be required to switch on and off certain autosys attributes on jobs. I find it easy to see everything in a box and then you can create another job to put things back again.
Not many people know that you can run an update jil command from the graphical interface. all you have to do is specify this in the command line
command: echo "update_job\: runs_every_day job_type\: c start_times\: " | jil

- 1
- 1
AutoSys allows you to add, amend & delete the job with below attribute for job name.
insert_job: JOB_NAME
--> Need to provide other sub attribute as per job type selected.
update_job: JOB_NAME
--> Only need the sub attributes which need to amendment. If one want to remove one then value should replaced with single blank and amendment need to be replace with new value. Some of the sub attributes are dependent on others sub attribute such as start_times
will take effect only when date_conditions
has been set to either TRUE or FALSE.
delete_job: JOB_NAME
--> No other sub attribute is needed

- 13
- 4