Purging logs in Datastage using a UNIX Script
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 21
- Joined: Mon Jul 12, 2010 2:05 am
- Location: India
Purging logs in Datastage using a UNIX Script
Need a customized unix script to purge the log in data stage. The only condition is,if it is a successful job then the log must clear for just one day, If it is an aborted job, then the log must be fully cleared.
-
- Participant
- Posts: 21
- Joined: Mon Jul 12, 2010 2:05 am
- Location: India
Two points:jpradeep.net wrote:I want the script for the second part. that is for this condition "If it is a successful job then the log must be fully cleared, If it is an aborted job, then the log must clear for just one day."
1. We'll be glad to help you write one, don't expect someone to just hand one to you.
2. You just completely reversed the requirement.
Aren't those requirements now equal? Meaning, if good runs clear the log what other days would exist in the log when the job fails?
Things to look into. Use dsjob with the -jobinfo option to check a job's status. And while there are options to display log information via dsjob (-logsum,-logdetail,-lognewest) there's no mechanism there to purge anything. For that you'll need to shell into the project in question using dssh and issue commands like CLEAR.FILE there. However, off the top of my head I'm not aware of any API to remove individual log entries.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Interesting but that must be behaviour that was changed in 8.x:
Regardless, I have some concerns that it seems you want to remove information about a failed run automatically before anyone has a chance to see it. Is that the case?
Before 8 auto-purge only worked for successful runs.When Auto-purging is in use, all instances of a job will be purged, without checking for the success or fail status.
Regardless, I have some concerns that it seems you want to remove information about a failed run automatically before anyone has a chance to see it. Is that the case?
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 21
- Joined: Mon Jul 12, 2010 2:05 am
- Location: India
Nothing can replace a good course in basic scripting. In the meantime, one of my best reference investments -- since I didn't expect to have much local help after I took that course -- is Unix in a Nutshell by Arnold Robbins, O'Reilly Media Inc. It looks like the fourth edition is still the most recent: http://shop.oreilly.com/product/9780596100292.do
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872