pass value between jobs

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I got your back on that one Craig.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you be more precise about what the source of the value is? Are you going to extract a different value from each partition? Is it once per run or once per row? What value(s) do you need to be supplied to the second job (presumably as a parameter value)?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
PeterPol
Premium Member
Premium Member
Posts: 73
Joined: Wed Mar 08, 2006 8:59 am

Post by PeterPol »

Ok, in more detail:

I want to select rows from an ODBC source table (dbf) that have duplicate values in a given column. Only 2 of these rows should be written to a sequential logfile. Additionally, an extra line should be added to the end of this file with the number of duplicates and the percentage of duplicates in the source file.

To do this I made a sequence job containing 2 jobs:
One PX job to extract the given 2 rows (using head stage) from the source and write these to the logfile
One job to add the extra number and percentage of dups to the same logfile.
The determine this percentage in the second job, I want to pass the calculated number of dups from the first job to the second using ..... a userstatus value. I use a PX job so that I can use the head stage for extracting 2 rows. I don't know how to do this in a server job, by the way. However, by using PX, I can not set the userstatus, as several posts made already clear.

Peter
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Store that value in a sequential file. Pass it as a parameter to the second job. And in the Job Sequence while setting the value, call a basic routine that does nothing but cats the contents of the file using DSExecute(). Search the forum for more details, it has been discussed time and again.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

So the required value is in a file and you want to pick it up to pass to another job as a job parameter.

In the job sequence you have many choices, but probably the easiest is to use an Execute Command activity to cat the file; you can then use the "angle bracket" notation to get the appropriate line from the file, for example ECActivity.$OutputValue<3> to return the third line. Or your cat command could be piped through grep (or you could use sed or awk) to isolate the required value.
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