Page 1 of 2

Can we export joblog to a file

Posted: Tue Apr 17, 2007 10:37 pm
by chitravallivenkat
Hi All,

Can we export/save the joblog or job status to a file??

I want to use that file in some other application so that i can derive the elapsed time of the job and other details.

I just want to take the information about the job out of DataStage application...

Please reply... Thanks in Adv..

Regards

VC

Re: Can we export joblog to a file

Posted: Tue Apr 17, 2007 11:43 pm
by priyadarshikunal
chitravallivenkat wrote:Hi All,

Can we export/save the joblog or job status to a file??

I want to use that file in some other application so that i can derive the elapsed time of the job and other details.

I just want to take the information about the job out of DataStage application...

Please reply... Thanks in Adv..

Regards

VC

I think u can use API function DSGetLogEntry to retrive log details and then redirect it to a file

Posted: Wed Apr 18, 2007 12:09 am
by ray.wurlod
You can use the Print dialog from Director (check Print To File).
You can create a DataStage job to do it.
You can create a routine using the DataStage API - depending on what you want you may need various of the DSGetLog... functions.

However, it's probable that most of the details you require are accessible from the API without accessing the log. Research the other DSGet...Info functions.

Posted: Fri Apr 20, 2007 12:15 am
by rkdatastage
Hi Priya

Can you give some input on writing a code step by step to store the log details into a file.

thanks in advance
RK

Posted: Fri Apr 20, 2007 12:25 am
by ray.wurlod
Most of what you need is here - doesn't your Search button work?

Posted: Fri Apr 20, 2007 3:57 am
by chitravallivenkat
Thanks Ray..


I have used the Print to file option...


VC

Posted: Fri Apr 20, 2007 6:54 am
by chulett
Wow... I thought Ray only ever threw that out there as a teaser. :wink:

Only time I use it is to create artifacts for Support - "send me the job log". Otherwise, one typically seeks a more automated solution. Glad that worked for you.

Posted: Wed Apr 25, 2007 2:03 am
by jeawin
I have written two DataStage jobs that reproduce the Director log, and also the same details as shown in the Monitor window. Both of these are saved to CSV files on the Server. The files can then be FTP'd or whatever onto your PC.

Here are examples of the output:

Image

Image

Let me know if you would like a copy of the jobs.

Posted: Wed Apr 25, 2007 5:00 am
by rafik2k
jeawin
Is your job automated for every job for a project?

Can you please share logic of your job

Posted: Wed Apr 25, 2007 7:28 am
by DSguru2B
The images are not showing up. :roll:

Posted: Wed Apr 25, 2007 8:03 am
by raewu
that's a great tool you've made there

Posted: Wed Apr 25, 2007 8:05 am
by DSguru2B
Never mind, its blocked on our intranet. Ill check it out at home. Disregard my previous post.

Posted: Wed Apr 25, 2007 8:08 am
by jeawin
No, the jobs are not automated, though can obviously be scheduled.

The Metrics job has the following parameters:
CATEGORY: Enter one or more categories here
PATH: Full path name to output csv file directory
FNAME: Output CSV file name

The Monitor Details job has the following parameters:
CATEGORY: EITHER: for report on one or more categories, enter them here
JOBNAME: OR: for report on single job only, enter job name here
PATH: Full path name to output csv file directory
FNAME: Output CSV file name

CATEGORY can be delimted by a comma, semicolon or space.

The logic is quite fun, and is primarily based on the contents of the RT_LOGnnnn Universe file. The DS_JOBS file is parsed for all jobs that meet the parameter criteria, then for each job selected the RT_LOG and RT_STATUS files are interrogated for the relevant details, and an array of the details is built.

Jobs that are running are ignored. Jobs running over midnight or for several days are catered for, as are multiple instances of jobs.

The array is then squirted out, a job at a time, as a semicolon-delimited file.

Posted: Thu Apr 26, 2007 12:49 pm
by laknar
Can you give step by step code to store the log details into Excel file

Please provide me code.

In parallel jobs is preferrable.

Thanks & Regards,
laknar

Posted: Thu Apr 26, 2007 4:56 pm
by ray.wurlod
The jobs write to CSV files. You open these with Excel. Voila!