Delete Multiple Datasets

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sshettar
Premium Member
Premium Member
Posts: 264
Joined: Thu Nov 30, 2006 10:37 am

Delete Multiple Datasets

Post by sshettar »

Hi All,

i wanted to know how to delete multiple datasets in one command line . I did go through couple of posts but dint find any soultion for my requirement .

Most of our intermediate datasets are stored in one staging folder and we have several datasets . now we need to delete all of these datsets once all our jobs have run at the end of the day .
I tried using execute command stage at the end of my job sequence and gave the command

orchadmin delete C:\IS_Projects\DS_Data\Target\Sandbox\ds_valid

It is working fine if i delete one dataset
But i want to delete all the datsets in the folder C:\IS_Projects\DS_Data\Target\Sandbox\ and i tried giving this command

orchadmin delete C:\IS_Projects\DS_Data\Target\Sandbox\*.ds

It dint work

i also gave (since we store all our datasets names as ds_dataset_name

orchadmin delete C:\IS_Projects\DS_Data\Target\Sandbox\ds_*

It dint work too

I would appreciate if someone could help me achieve this

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How about a shell script that loops through the file names generated by the regular expression and issues the orchadmin against each? (Yes, I know you're on Windows, and I also know that MKS Toolkit installs with version 8.0 on Windows, so you can use a shell script.)

Code: Select all

for filename in /IS_Projects/DS_Data/Target/Sandbox/*.ds 
do
   orchadmin delete $filename
done
Last edited by ray.wurlod on Wed Sep 17, 2008 9:27 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
4492_dsnoel
Participant
Posts: 5
Joined: Wed Sep 17, 2008 12:24 am
Location: Think BIG ,Start small and Skills fast

Re: Delete Multiple Datasets

Post by 4492_dsnoel »

try to use this

orchadmin rm C:\IS_Projects\DS_Data\Target\Sandbox\*.ds
Think BIG,start small & skills FAST...
steele
Premium Member
Premium Member
Posts: 12
Joined: Thu Jul 14, 2005 2:16 pm

Re: Delete Multiple Datasets

Post by steele »

4492_dsnoel wrote:try to use this

orchadmin rm C:\IS_Projects\DS_Data\Target\Sandbox\*.ds
What happens if there are multiple resource disks configured? Go with the shell script!
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Typically the descriptor (*.ds) files are not stored on the resource disks - the pathnames on the resource disk(s) are stored within the descriptor files.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Nagaraj
Premium Member
Premium Member
Posts: 383
Joined: Thu Nov 08, 2007 12:32 am
Location: Bangalore

Post by Nagaraj »

Shettar were you able to delete the files finally?
Please post the solution and mark it as resolved if you havent
Post Reply