how to get values from an xml file to a variable in routine

Formally known as "Mercator Inside Integrator 6.7", DataStage TX enables high-volume, complex transactions without the need for additional coding.

Moderators: chulett, rschirm

Post Reply
parvathi
Participant
Posts: 103
Joined: Wed Jul 05, 2006 4:48 am
Contact:

how to get values from an xml file to a variable in routine

Post by parvathi »

Hi all,
I have generated an xml fileof the attached job in a routine.
the xml file contains the full information of the job.

Now i want to get job's process id and stage pid and cpu time from the xml ile generated .

Is there any way todo that.
Please help me
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Is this a server/parallel job or a TX job?
If the former, you can use DSGetStageInfo() using the DSJ.STAGECPU key to get CPU time used in a stage. There is still a bug in this value, it doesn't actually return the CPU time used, but the CPU percentage; so you have to use the stage runtime computed by values returned in DSJ.STAGESTARTTIMESTAMP and DSJ.STAGEENDTIMESTAMP to get actual CPU time used.
The PID of a stage can be returned via the DSJ.STAGEPID key to DSGetStageInfo().
parvathi
Participant
Posts: 103
Joined: Wed Jul 05, 2006 4:48 am
Contact:

Post by parvathi »

ArndW wrote:Is this a server/parallel job or a TX job?
If the former, you can use DSGetStageInfo() using the DSJ.STAGECPU key to get CPU time used in a stage. There is still a bug in this value, it ...
this is a server job. Is it not possible to get from the xml file
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Read the XML file and parse the tags. When you've found the start tag start collecting characters until you find the end tag. You can use the Index() function to determine the character position of the tags.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply