Page 1 of 1

Any feature to create html output

Posted: Tue Dec 15, 2015 9:29 pm
by mouthou
Hi All,

Is there any feature in DS to put select query result in an html output file. There is set of XML features but not sure if HTML output can be created using DS. Appreciate your opinion if you have tried or any suggestion?


Thanks

Posted: Wed Dec 16, 2015 3:45 am
by ArndW
I don't know of a specific feature to do this. While XML and HTML are quite similar and creating XML output and then modifying the result to change it to HTML, it is probably easier to add your start and end tags to the data manually. That is assuming you want to add simple formatting.
What sort of tags do you plan on adding?

Posted: Thu Dec 17, 2015 2:25 pm
by MrBlack
Could you just create an XLST file so that when you view the XML file in a web browser you can get all the prettiness of an HTML file but the data is still XML. I'd be curious to know what you use case is for this because it sounds like you're starting to mix DATA (xml) with the UI (html).

Posted: Mon Dec 21, 2015 9:00 pm
by mouthou
Hi MrBlack,

I am not getting your suggestion of XLST/XML in relevance to my scenario (as not dealing with XML data at all and XML wont be an issue in DS). My use case is to send the output of a query to .html file so that the target system can make of use it.

Thanks

Posted: Tue Dec 22, 2015 2:27 am
by ray.wurlod
Convert all your output columns to VarChar, and derive them with begin and end element tags. That will get you very close.
Optionally use before-job and after-job subroutines to create headers and trailers.

Posted: Mon Jan 04, 2016 12:42 am
by mouthou
Thanks all for your responses. It looks there is some limitation while dealing with html source/target alone, unlike how IBM provided features for XML processing.

Posted: Mon Jan 04, 2016 5:06 am
by eostic
There never has been much call for DataStage to create formal .hmtl..... probably because using xml with a stylesheet reference is a very powerful solution. Use DataStage to craft a valid xml document with embedded stylesheet reference, and then get as fancy as you want with the stylesheet. Far more powerful than trying to generally decide on what you might want for generic html formatting tag by tag by tag.

That being said, if it is just simple column display, following the rows and columns of your output link, then it is probably just as easy, as Ray noted, to "zap" in your desired html as formal strings inside of a transformer.

Ernie

Posted: Tue Jan 05, 2016 2:30 pm
by kduke
I had a routine in EtlStats which did what Ray describes. I don't think it works in newer versions. If you are outputting to a sequential file then you can concatenate all columns into one column. Then you could build a html header and footer record from a row generator then output all to a funnel stage. You need one extra column for record type. Sort by this. So a header is type 1. All records are type 2. Footer is type 3.

Should not be too hard.