How do you delete files in particular directory using DS Job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
pongal
Participant
Posts: 77
Joined: Thu Mar 04, 2004 4:46 am

How do you delete files in particular directory using DS Job

Post by pongal »

Hi
I wanted to delete .dsx files in a temporary folder resides at DS Server using DS JOB.
Thanks in advance....
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Are you having both Server and Client installed in the same machine?

Because the dsx is generally produced on the client machine.

If you want to delete it, use the windows 'Search' option and decide which ones to delete. This is because the dsx are used to backup the DataStage Project components.

Can you provide an example where these are created in temporary directories?

Note - dsjob are used to run new jobs and hence not needed for this purpose.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Code: Select all

openpath "MyDir" to MyDir else stop
delete MyDir, "Filename" else stop
You can do this in a routine. I would suggest you do some error logic instead of using "stop" or Ray will be upset. I would pass the directory and filename as arguments. You could also do this in job control code as well.
Mamu Kim
nandu_infy
Participant
Posts: 3
Joined: Tue Feb 15, 2005 7:19 am

Re: How do you delete files in particular directory using DS

Post by nandu_infy »

juz call a shell script from the job and do

cd <urDir>
del *.dsx
Post Reply