Can we export joblog to a file

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

chitravallivenkat
Participant
Posts: 106
Joined: Thu Jun 08, 2006 8:51 am

Can we export joblog to a file

Post 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
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Re: Can we export joblog to a file

Post 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
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
rkdatastage
Participant
Posts: 107
Joined: Wed Sep 29, 2004 10:15 am

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Most of what you need is here - doesn't your Search button work?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chitravallivenkat
Participant
Posts: 106
Joined: Thu Jun 08, 2006 8:51 am

Post by chitravallivenkat »

Thanks Ray..


I have used the Print to file option...


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

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
jeawin
Participant
Posts: 18
Joined: Mon Oct 04, 2004 6:49 am
Location: Milton Keynes
Contact:

Post 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.
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

jeawin
Is your job automated for every job for a project?

Can you please share logic of your job
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

The images are not showing up. :roll:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
raewu
Premium Member
Premium Member
Posts: 5
Joined: Thu May 12, 2005 9:51 am
Location: københavn, DK

Post by raewu »

that's a great tool you've made there
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Never mind, its blocked on our intranet. Ill check it out at home. Disregard my previous post.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
jeawin
Participant
Posts: 18
Joined: Mon Oct 04, 2004 6:49 am
Location: Milton Keynes
Contact:

Post 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.
laknar
Participant
Posts: 162
Joined: Thu Apr 26, 2007 5:59 am
Location: Chennai

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The jobs write to CSV files. You open these with Excel. Voila!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply