Page 1 of 1

Write data to HTML

Posted: Tue Sep 29, 2009 5:25 pm
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.

Posted: Tue Sep 29, 2009 7:19 pm
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!

Posted: Tue Sep 29, 2009 9:38 pm
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.

Posted: Wed Sep 30, 2009 3:34 pm
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.