Page 1 of 1

Capture Log and store it into Db2 DB

Posted: Sat Jan 22, 2011 8:33 pm
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

Posted: Sun Jan 23, 2011 3:47 am
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.

Posted: Sun Jan 23, 2011 2:51 pm
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...

Posted: Mon Jan 24, 2011 11:19 am
by Shruthi
This can be done in after job routines. You can use DSGetLogSummary and connect to database to add entry in DB2 tables.

Posted: Mon Jan 24, 2011 12:37 pm
by jack_125
Thanks a lottt Shruti... You rock...!!!

Posted: Mon Jan 24, 2011 12:49 pm
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,

Posted: Wed Jan 26, 2011 11:42 am
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