Write data to HTML

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
vinnz
Participant
Posts: 92
Joined: Tue Feb 17, 2004 9:23 pm

Write data to HTML

Post by vinnz »

Is there a way to make DataStage write information out to a HTML table? I have a job currently that writes to a delimited file but I have been asked to convert that to a HTML report of sorts and email it. I believe I may be asked to convert a few more jobs as well so the solution needs to be easy enough to adapt to other jobs.

Things I've been exploring are below

1. Use XML stage and then add the output between <xml> tags using simple cat commands to product a file that the browser can parse. Support for the tag seems limited to IE and works okay but needs a lot of customization for each job.

2. Have the output written to a plain csv/delimited file and then use a shell/awk script to convert that file to html. The job + script can be called in a job sequence and email the result as an attachment from the sequence. This approach seems better as I work through my limited awk knowledge.

Are there any better approaches that have been tried & tested from within DS?

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

Post by ray.wurlod »

A final Transformer stage to add the HTML tags (at least the <tr> and <td> tags) might be feasible - although it would be like writing HTML with Notepad!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

One of the jobs I give away with EtlStats will take any SQL statement run it against a DSN and send it as an attachment. It is named something like GenHtmlFromSql. I tend to run the same SQL over and over and send them out during my ETL runs. So there is a driver job which will run SQL in a file. So all you need to do is say run MySqlStatement.sql. Very clean. Very easy.
Mamu Kim
vinnz
Participant
Posts: 92
Joined: Tue Feb 17, 2004 9:23 pm

Post by vinnz »

kduke wrote:One of the jobs I give away with EtlStats will take any SQL statement run it against a DSN and send it as an attachment. It is named something like GenHtmlFromSql. I tend to run the same SQL over and ...
Thanks Kim, I will take a look at this job.
Post Reply