can a batch return a value?

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
eoyylo
Participant
Posts: 57
Joined: Mon Jun 30, 2003 6:56 am

can a batch return a value?

Post 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
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post 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
eoyylo
Participant
Posts: 57
Joined: Mon Jun 30, 2003 6:56 am

Post 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
denzilsyb
Participant
Posts: 186
Joined: Mon Sep 22, 2003 7:38 am
Location: South Africa
Contact:

Post 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
dnzl
"what the thinker thinks, the prover proves" - Robert Anton Wilson
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
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