Parallel routine to call DSGetJobInfo

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

Post Reply
platonfi
Premium Member
Premium Member
Posts: 27
Joined: Mon May 26, 2008 1:39 am

Parallel routine to call DSGetJobInfo

Post by platonfi »

I try to figure out how to use DSGetJobInfo in Parallel C++ routine, but coud not find any examples. I have following Server routine which I try to translate into Parallel routine. It simply returns USERSTATUS of the job.

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H 
$INCLUDE DSINCLUDE DSJ_XFUNCS.H 
ErrorCode = 0
JobHandle = DSJ.ME 
Ans = DSGetJobInfo(JobHandle,DSJ.USERSTATUS)
My best guess for the same in Parallel C++ routine is following:

Code: Select all

#include <stdlib.h> 
#include <stdio.h> 
#include "C:\IBM\InformationServer\Server\Dsdk\Include\dsapi.h" 

int GetUserStatus(char *RetUserStatus) 
{ 
return GetJobInfo(DSJ.ME, DSJ_USERSTATUS, RetUserStatus); 
}
I know that DSJ.ME is availabe in DS BASIC, but what would be corresponding in C++ DSAPI?

How about returning USERSTATUS value. Could it work like I wrote it? Anything else that might be wrong?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Parallel Job Advanced Developer's Guide (version 8) page 801. There is no mention of an explicit equivalent of DSJ.ME because, in the C API, you have to declare the appropriate structure before you call DSOpenJob().
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
platonfi
Premium Member
Premium Member
Posts: 27
Joined: Mon May 26, 2008 1:39 am

Post by platonfi »

Thanks for your reply.

The problem is that DSOpenJob requires Jobname as parameter. How can you refer the job where the routine is called from? You just can't hardcode jobname in your routine, neither parametrising the name is a convenient solution. It would require the routine calls to be changed by a job designer in case of renaming a job.

Are there any complete parallel routine code examples using DataStage C API functions available somewhere?
Post Reply