Page 2 of 2

Posted: Thu Feb 01, 2007 1:52 pm
by DSguru2B
I got your back on that one Craig.

Posted: Thu Feb 01, 2007 4:09 pm
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)?

Posted: Fri Feb 02, 2007 2:19 am
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

Posted: Fri Feb 02, 2007 7:52 am
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.

Posted: Fri Feb 02, 2007 3:10 pm
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.