log summary past a date

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

mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

log summary past a date

Post by mystuff »

Code: Select all

dsjob -logsum project job
gives the log information for a job, but it also fetches earlier logs as well.

Is it possible to specify somewhere to obtain logs of a job only after specified period of time or say logs after so and so date.
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Post by jdmiceli »

Read the documentation or search DSGetLogSummary or DSGetLogEntry. You might be able to get what you are looking for from one or both of these if I understand your question correctly.

Merry Christmas!
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

Post by mystuff »

I am writing a script, so I am looking how to do it using "dsjob -logsum". I didn't see any option in this command. Is there anyway to do it?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

mystuff - as you've already guessed, the dsjob -logsum command will not let you filter the output; which is why jdmiceli suggested an alternate method.
I don't have a version of 7 to play with, but I think you might be able to use dsjob -jobinfo to get the message number or start date or wave number of the last run and then use the -logdetail option with the wave number or message number to retrieve that information.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

The documentation shows the two options the command supports: -type to control what message types you want and -max to limit the number of records returned.

You'd need to pull a log summary and then use that to determine what information you want, what range of message numbers is needed. Then use the -logdetail option to pull the detailed logs for the rang in question.
-craig

"You can never have too many knives" -- Logan Nine Fingers
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

D'oh... this is what happens when you get distracted and forget to click 'Submit' for 10 minutes. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

Post by mystuff »

ArndW
I don't have a version of 7 to play with, but I think you might be able to use dsjob -jobinfo to get the message number or start date or wave number of the last run and then use the -logdetail option with the wave number or message number to retrieve that information.
I don't see any option of wavenumber or message number in -logdetail. Am I missing something?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

It is likely that you aren't missing anything, the -wave is probably a new option at Version 8.
mystuff
Premium Member
Premium Member
Posts: 200
Joined: Wed Apr 11, 2007 2:06 pm

Post by mystuff »

Then don't I have any option using to filter out using datastage CL utilities :(
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

No, it seems not. But you can use the DSGet...() routines from a DataStage job to create exactly the type of log file you want; you can call this job using the dsjob command and then parse the output file as desired.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not sure what you mean - the last parameter to the -logdetail function is the entry number you want. So you get the range from the summary function and then iterate through the range and pull all of the detail entries. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Source code for dsjob is in the manuals. You can adapt that you suit your own particular needs.

Why not create a server job to read (and filter, based on job parameters) a job log (the name of which is given as a job parameter)?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Post by jdmiceli »

You had mentioned that you were trying to do it from the command line, so what if you ran the dsjob -logdetail and piped it to a text file then used Perl or whatever to parse that file for what you are looking for.

Just a thought,
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
jdmiceli
Premium Member
Premium Member
Posts: 309
Joined: Wed Feb 22, 2006 10:03 am
Location: Urbandale, IA

Post by jdmiceli »

You had mentioned that you were trying to do it from the command line, so what if you ran the dsjob -logdetail and piped it to a text file then used Perl or whatever to parse that file for what you are looking for.

Just a thought,
Bestest!

John Miceli
System Specialist, MCP, MCDBA
Berkley Technology Services


"Good Morning. This is God. I will be handling all your problems today. I will not need your help. So have a great day!"
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

dsjob -lognewest will provinde the entry number. You can use that with the -logdetail option. It does'nt showup in help but it works. Atleast in 7.5.1A, it does.
You can save the entry number and use that entry number to get the log details after a certain date.
Say you want your script to generate logs for the last six days, save the entry number six days in advance and use that to get the log entry.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Post Reply