Capture Log and store it into Db2 DB

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
jack_125
Participant
Posts: 15
Joined: Fri Jul 30, 2010 9:46 am

Capture Log and store it into Db2 DB

Post by jack_125 »

Hi All,
I've a job requirements that require to capture the logs and store them
into a DB2 database. I can assume that we might be able to do that
with after job sub-routine or any kind of job activity.
Please give me some guidence.



Thanks
JackSh
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If your repository is DB2 and you're using logging to the common repository, then your logs are already in DB2.

Otherwise I'd recommend using a server job, because in the local repository hashed files are used to store job logs and server jobs are specifically equipped to deal with hashed files.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jack_125
Participant
Posts: 15
Joined: Fri Jul 30, 2010 9:46 am

Post by jack_125 »

Thanks Ray,
Your reply seems very important but due to premium membership
I am not able to see the whole post. But thanks a lottt...
JackSh
Shruthi
Participant
Posts: 74
Joined: Sun Oct 05, 2008 10:59 pm
Location: Bangalore

Post by Shruthi »

This can be done in after job routines. You can use DSGetLogSummary and connect to database to add entry in DB2 tables.
jack_125
Participant
Posts: 15
Joined: Fri Jul 30, 2010 9:46 am

Post by jack_125 »

Thanks a lottt Shruti... You rock...!!!
JackSh
jack_125
Participant
Posts: 15
Joined: Fri Jul 30, 2010 9:46 am

Post by jack_125 »

Shruthi,
One more thing, I dont see DSGetLogSummary instead ther is DSJobReport is avaible. But it will be very helpful if you can give some guidance about how to set-up it into the database.


Rgds,
JackSh
darrreever
Participant
Posts: 19
Joined: Tue Feb 23, 2010 11:15 am
Location: Los Angeles

Post by darrreever »

I see this post is a little dated. However, for those needing to capture job information including rows down a link, here's a how to using an XML file (if you are unfamiliar with the XML stage this is an easy way to familiarize yourself):

For each job

Edit>Job Properties > After-Job subroutine > DSJobReport
Input Value: 2;C:\Data (any directory you like)

The "2" value will create an XML File. You can find other options, such as txt, by using Help search on "DSJobReport"

Compile and Run the job.

Import the XML file metadata from the directory you selected. Import>Table Definitions > XML Table Definitions

Place a check in the Document > Job > Name, StartDateTime, EndDateTime, and others as desired.

Optionally, place a check in the ComponentSet> InstanceSet>Instance > Link Name and RowCount as desired. (getting a specific link name will require a Transformation stage, see next steps, and appropriate constraints)

Create a job with an XML Input.
XML Input> output >Columns, "Load" the XML metadata.

Be aware of the TransformationSettings> Repitition element required checkbox if you have issues.

Also be aware of the XML Input > Stage > TransformationSettings> Repitition element required checkbox if you have issues.

Finally the output link can go to other processing stages as desired, e.g. Transformer to select link names or database/flat file.

Lastly, you can create the job as either a shared container or as a job in a sequence which does a loop through all of the files.

Hope this helps. God Bless
Darryl
Post Reply