Page 1 of 1

Encode

Posted: Tue Jan 15, 2008 9:34 am
by vijayg
I need to read a falt file, create a XML file and XML File should be encoded to base64 before sending out/ftp.

Please let me know how we do this in datastage? even if you have done anyother encodeing(other than base64) please let me know tooo.

Thanks for the help.

Posted: Tue Jan 15, 2008 2:45 pm
by ray.wurlod
Welcome aboard.

I assume "falt file" is a typo. Use Sequential File stage, XML Output stage, External Target stage. In the External Target stage execute your uuencode command and direct its output into a file, then run a script to FTP this whereever it needs to go. Optionally delete/move the data file when done.

Posted: Fri Jan 18, 2008 8:54 am
by vijayg
Ray,
Thank you very much for the reply. I guess your solution is perfect for the question I had asked.

Guys, My problem here got little more complicated, now we need to encoded only data in the XML leaving header information in XML not encoded.

Again thanks for the help in advance.

Vijay.

Posted: Fri Jan 18, 2008 3:11 pm
by ray.wurlod
Do it in an after-job subroutine. Your job writes the header and body separately. The after-job subroutine encodes the body and (possibly) cats the head and body together. The result is then transferred.

You can use DataStage BASIC code or shell script. Doesn't matter.

Posted: Sat Jan 19, 2008 2:08 pm
by vijayg
Good Idea! I will try it on Monday and update you all. I also had little bit of problem using external stage, I am new to this new environment.

Thanks so much.
Vijay.