Delete a category from command line

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

nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

Delete a category from command line

Post by nvalia »

Hi,

Is it possible to delete a category and not the full project from the command line..may be from a Unix script.

Regards,
NV
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

No, you can't delete jobs in any fashion outside of the Clients.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

It is possible from from UV only if you are ready to hack the DS_JOBS file, and that too only after deleting all the jobs residing inside the category.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Danger!! Danger!!

It's not only DS_JOBS that you need to hack. Therein lies your dilemma.

Don't attempt it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Category is not stored in DS_JOBOBJECTS.
Still as Ray sugessted, it is not advisable to work with this hashed files.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Didn't say that. But if you remove a category there is a containment relationship, and you will need to remove the contents of that category. That means not just DS_JOBOBJECTS but also all the run-time tables RT_* for the jobs in question!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

All those RT_* files will be generated only when the jobs/routine/transform.. created or compiled or made to run. But not for Category. Category is just a logical clasification of job and routines maintained in DS_JOBS.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, but if you delete a category you must also delete the objects contained in it.

If you do this in the client, a warning message pops up indicating that this will happen. If you do it from the command line you're on your own.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Absolutely. That is what I mentioned in my first post. If a category needs to be deleted the jobs residing in that category need to be deleted.
Moreover you cannot delete a category from command line, if it has a content in it (though it might show you it has been deleted)
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

So one option is move the content of the category to other category first and then delete.

Code: Select all

UPDATE DS_JOBS SET CATEGORY = 'New_Category' WHERE CATEGORY = 'Old Category'

DELETE DS_JOBS WHERE NAME LIKE '\\\Old Category'
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Kumar, this is exactly what Ray was saying not to do. If you delete a job in Designer or Manager then DS_JOBOBJECTS also gets cleaned out and RT_CONFIGnnn, RT_LOGnnn, RT_BPnnn, RT_BPnnn.O, RT_STATUSnnn and a few other files get removed. If you do not do this properly then your repository gets orphaned files and records. Not good.

I would never do this and I think I know more about these tables than most of you. I think most or all of the top posters would never do this.
Mamu Kim
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

I totaly with your Kim. I too suggest not to deletet the job from DS_JOBS. OP is looking for deletion of category and not job. Category alone doesnt have any hash of its own.
Whatever it be, its not advisable to delete directly from repositry.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

kumar_s wrote:OP is looking for deletion of category and not job.
:? How do you know this? The OP didn't explicitly state that. My first thought was that they wanted to delete a category - and all jobs in it - from the command line and that's where my money is.

Regardless, please be careful about handing out advice that involves direct manipulation of the repository tables. Querying is one thing, but updates and deletes may just earn someone a trashed project and a trip to the woodshed. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
nvalia
Premium Member
Premium Member
Posts: 180
Joined: Thu May 26, 2005 6:44 am

Post by nvalia »

Hi All,

Thanks for all the replies. Just to clarify,yes we would like to delete all the jobs as well when we would want to delete the category conatining it.
The reason for this is, when we move a category (all jobs) to Production, we would like to clean up that category in DEV so as to ensure the next time we want to modify it (for any reason) we pull the dsx from the Source Code contoller and Import it to ensure proper version.
Also this ensures we can still continue to work on other Category (jobs) in the same project that are still in development.
The idea is to move things one at a time to Prod. (Any other solution to this approach is most welcome)

Apologies for the long mesage..thought it is better to clarify in detail

NV
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

If a category is moved, why should it be deleted. I was under the impression (false impression) that you want to delete only the empty category. Craig pointed out that cleanly.
If the jobs are moved to production via version control, it doesnt mean you need to delete the category in Dev, rather create a new project and work on it, if the number of job involved in an category is enormously high.
The best option to delete the category with the job is right click on the category either in designer or manager and click on delete. And say yes to the popup.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
Post Reply