Page 1 of 1

Delete 100 jobs via script

Posted: Wed Apr 13, 2016 9:35 am
by mandyli
Hi

I would like delete unused jobs from DataStage repository. Is there any way I can run scripts to delete the these jobs?


Thanks
Man

Posted: Wed Apr 13, 2016 11:16 am
by chulett
You can use istool to delete DataStage assets as noted here. You'll need to know what type of job it is in order to leverage that.

Posted: Wed Apr 13, 2016 12:23 pm
by mandyli
Thanks Lot.

how to initiate the istool command

ex: cd $DSHOME
istool> delete -help

Thanks
Man

Posted: Wed Apr 13, 2016 12:46 pm
by chulett
From the link:
The preferred way to run this command is in the istool command-line window. If you run this command in your operating system command-line window or in scripts, you must add istool to the command name.
Based on your initial requirements of doing this from a script, it sounds like you should go with the latter. And if for some reason you've not used it before, there are a plethora of posts here on 'istool' and its syntax.

Documented here. Andy post here.

Posted: Wed Apr 13, 2016 2:22 pm
by mandyli
Sorry I got it.

istool from client side not from server side.

is this safe way to delete the jobs using istool?


Thanks
Man

Posted: Wed Apr 13, 2016 4:05 pm
by chulett
Well... it's an official way and orders of magnitude safer than when I've seen people roll their own and run delete SQL against the repository. :shock:

Posted: Wed Apr 13, 2016 4:58 pm
by ray.wurlod
I'd still prefer to use Director client. Disable view of folders and you can see all jobs in the project (probably make the refresh interval quite long too). Then you can take your time over selecting the correct jobs before deleting.

Don't forget to backup (export project) before deleting.