14

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.

goric
  • 11,491
  • 7
  • 53
  • 69

7 Answers7

25

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

Community
  • 1
  • 1
clmccomas
  • 684
  • 6
  • 8
3

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>
2

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.

Nono Taps
  • 123
  • 2
  • 11
0

update_job: YOUR_JOB_NAME start_times: 04:00

Manjul
  • 189
  • 4
0

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-------------------
0

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
0

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

Pradeep
  • 13
  • 4