Hi Friends,
I need your help in understanding Of jobelapsed return info type from the DSGetjobinfo.
It's a char pointer to JobElapsed. DSGetjobInfo says it returns elapsed time of the job in secs.
Does anyone know how exactly it returns the result?
Is it in the time formal like 00:00:04 for 4 secs or just 4 secs.
Is there any conversion required once it returs char * value. I get Sigsegv error in the parallel routine when I set return value to char * in the Datastage parallel routine.
Is this a known bug? Am I mssing anything.. How to resolve this issue.
Thanks,
Job elapsed in DSGetjobinfo
Moderators: chulett, rschirm, roy
So you are calling the function from a C++ routine? The docs say that:
ReturnInfo is a pointer to a DSJOBINFO data structure where the requested information is stored. The DSJOBINFO data structure contains a union with an element for each of the possible return values from the call to DSGetJobInfo. For more information, see Data Structures.
Hope it helps somewhat. UCDI is our C Master, perhaps he can shine some light on this, worst case if no-one has the answer I'd suggest you open a support case.
ReturnInfo is a pointer to a DSJOBINFO data structure where the requested information is stored. The DSJOBINFO data structure contains a union with an element for each of the possible return values from the call to DSGetJobInfo. For more information, see Data Structures.
Hope it helps somewhat. UCDI is our C Master, perhaps he can shine some light on this, worst case if no-one has the answer I'd suggest you open a support case.
Last edited by chulett on Tue Aug 22, 2017 3:00 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
unions in strict c++ cannot be accessed both ways. That is, if you assign x.field1 and try to read x.field2 it is "undefined". In practice, it works on every compiler I have every heard of or used, so long as you do not set the compiler options to extremely strict.
a union is just a block of bytes in memory where the size is big enough to hold the biggest thing in the union.
so you should be able to get to it via
something = ReturnInfo[0].fieldname; //whatever field you want
where something is the type of fieldname, be it a char* or a double or whatever else.
I can look at your code if you want.
a union is just a block of bytes in memory where the size is big enough to hold the biggest thing in the union.
so you should be able to get to it via
something = ReturnInfo[0].fieldname; //whatever field you want
where something is the type of fieldname, be it a char* or a double or whatever else.
I can look at your code if you want.
again...
I haven't been able to resolve the issue with DSJ_JOBELAPSED. Can anyone let me know whats happening here.
DSJ_JOBELAPSED is a pointer to a character. char *jobElapsed;
The same routine works fine with DSJ_JOBNAME which is also a pointer to a char. char *jobName
partial code:
after defining DSPROJECT ProjectHandle and DSJOB JobHandle
char * ret;
DSGetJobInfo(JobHandle,DSJ_JOBELAPSED,ReturnInfo);
ret= (*ReturnInfo).info.jobElapsed;
return(ret);
I get the error when calling through a job
Tran,0: Operator terminated abnormally: received signal SIGSEGV
Tran,0: Fatal Error: ~APT_PMPlayer: terminating Player (node2, sequential APT_TransformOperatorImplV0S3_StrJobElapsed_Tran in Tran)
node_node2: Player 1 terminated unexpectedly.
main_program: APT_PMsectionLeader(2, node2), player 1 - Unexpected exit status 1.
I haven't been able to resolve the issue with DSJ_JOBELAPSED. Can anyone let me know whats happening here.
DSJ_JOBELAPSED is a pointer to a character. char *jobElapsed;
The same routine works fine with DSJ_JOBNAME which is also a pointer to a char. char *jobName
partial code:
after defining DSPROJECT ProjectHandle and DSJOB JobHandle
char * ret;
DSGetJobInfo(JobHandle,DSJ_JOBELAPSED,ReturnInfo);
ret= (*ReturnInfo).info.jobElapsed;
return(ret);
I get the error when calling through a job
Tran,0: Operator terminated abnormally: received signal SIGSEGV
Tran,0: Fatal Error: ~APT_PMPlayer: terminating Player (node2, sequential APT_TransformOperatorImplV0S3_StrJobElapsed_Tran in Tran)
node_node2: Player 1 terminated unexpectedly.
main_program: APT_PMsectionLeader(2, node2), player 1 - Unexpected exit status 1.