Page 1 of 1

can a batch return a value?

Posted: Thu Jun 10, 2004 2:34 am
by eoyylo
Hi,
in a datastage project I have s a batch (name A) that is attached and runned by an another batch (name B).
After the end of the run of the batch A, can A return a value to the batch B?

thanks in advance

Mario

Posted: Thu Jun 10, 2004 3:44 am
by Sreenivasulu
Write the output of batch"A" to a flat file. In Batch B read the contents
of the flat file to which batch "A" has written.

Regards

Posted: Thu Jun 10, 2004 3:56 am
by eoyylo
Thanks for the suggestion about the use of a flat file, but I'd like to know if it is possible that a batch return a value like a function.

thanks

Mario

Posted: Thu Jun 10, 2004 1:37 pm
by denzilsyb
this is possible if you are willing to use variables, the way we did it was to have several 'control' jobs pass variables to each other and so react based on the variable values recieved/passed.

will variable passing help? i.e. we have batch A and batch B. Batch A consists of job 1, 2, 3 and batch B consists of job 4, 5, 6. if job 2 fails, batch A has a status of failed and carries that status to batch B. This status triggers an email msg to the administrator and batch B to start batch A again to see if something has changed to allow job 2 to finish. it can be more flexible, but this is the basis.

this is best done not using the job sequencer, as we have found it is still a little limited; but coding a 'job control' using BASIC does the trick.. its just a bit more work.

dnzl

Posted: Thu Jun 10, 2004 6:57 pm
by ray.wurlod
Each batch can "see" the other's user status area. You could use this variable for communication. It persists even after the batch has finished.

Use DSSetUserStatus() function to assign a value to the user status area, and DSGetJobInfo(hJob, DSJ.USERSTATUS) to retrieve it.