uv command to clear all the log files for a project

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
dstechie
Participant
Posts: 2
Joined: Wed Jul 20, 2011 5:16 am

uv command to clear all the log files for a project

Post by dstechie »

Hi All,

I want to clear all logfiles and status with universe command for a particular project.

As of now I am able to clear logfiles for only one job with the command-

clear.file RT_LOG24 . It clears only job 24 .

Can any one help out with a single command which will clear all the logfiles for all jobs in a project.

Regards
dstechie
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There isn't one. You could build a routine that selects a list of job numbers from DS_JOBS and then issues a CLEAR.FILE for each one in a loop.

Code: Select all

SELECT NAME, CATEGORY, JOBNO FROM DS_JOBS WHERE NAME NOT LIKE '//%' AND NAME NOT LIKE '\\%' ORDER BY CATEGORY, NAME;
There are extra columns you can remove from the select or you can use them to log what you are doing. You could also do something strictly from UNIX by listing out the directory names matching RT_LOGnnn, cutting out the number portion and then issuing the matching clear in a do loop.

I'm curious why the need for something like this. You are taking advantage of the auto-purge functionality, are you not?
-craig

"You can never have too many knives" -- Logan Nine Fingers
dstechie
Participant
Posts: 2
Joined: Wed Jul 20, 2011 5:16 am

Post by dstechie »

Hi Chullet,

Thanks a lot for your reply.

The question came from another team. So I am not aware of the need of this requirement.

Please let me know if we are not supposed to use the above functionality.

Regards
dstechie
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There's no "not supposed to" here. Just curious why the question was asked. Many times we see questions like this asked because of an underlying problem when people should be explaining their problem to us rather than starting with their perceived solution, which many times... isn't.

If you find out, let us know.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply