Total Record on a XML File

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Geppo
Participant
Posts: 19
Joined: Wed Feb 05, 2003 5:25 am
Location: NAPOLI (Italy)

Total Record on a XML File

Post by Geppo »

I need to write on a XML file Output the number of the total record that i will insert on the file, Do U know ohw to do it, and if it's possible??
Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I doubt that it's possible with the XML Writer, but you can do it with a before-stage (or after-stage) subroutine, depending on where you want the extra information.
The easiest way is to invoke the subroutine that executes an operating system command (ExecSH on UNIX, ExecDOS on Windows), and execute an echo command. For example:
echo <TOTAL>#RecordCount#</TOTAL> >> #FileName#
(In this example I have shown RecordCount and FileName as job parameters; you can modify the technique to use variables and other mechanisms. Similarly, you could write your own subroutine that used the WriteSeq statement to add the information to the file.
Post Reply