"unused" is defined as:
- any job that has not been compiled
- any job that has not been "started" or "compiled" in the last 180 days (it would be great if "180" could be a parameter).
I am open to ideas, but the options I can see are:
1. Write a DataStage routine
2. Write a Unix script
The steps I can see are:
- Get all of the jobs in the given project.
- For each job, get the jobinfo and identify whether it is "unused".
- If a job is "unused", append it to a dsx export file.
- and then delete it from the project.
There's a slight preference for a Unix script, mainly because the support team currently knows Unix better than DataStage.
I've been reading through some posts here, and am tentatively exploring the uvsh commands, and various command line statements.
The concerns I have are:
a) How to check the return code after each step (such as after the export, and after the delete)?
b) Before deleting the job, how can we check whether it is referenced by another component (and do we need to delete the objects in a specific order, such as Job and then Sequence)?
To do the delete, I currently have the unix script containing:
Code: Select all
cd ${DSHOME}
/bin/uvsh<<EOF
LOGTO ${ds_project}
DELETE DS_JOBS ${ds_jobname}
LO
EOF
Am I on the right track, or can anyone suggest a better approach?
Thanks,
- g