Page 1 of 1

Job elapsed in DSGetjobinfo

Posted: Mon Aug 21, 2017 8:01 pm
by India2000
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,

Posted: Mon Aug 21, 2017 9:09 pm
by chulett
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.

Posted: Tue Aug 22, 2017 1:21 pm
by UCDI
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.

Posted: Mon Oct 09, 2017 1:35 pm
by India2000
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.

Posted: Sat Oct 14, 2017 8:39 am
by chulett
:!: These was no reason to post this again as a new topic, so I deleted it. As a bonus, you get a free bump of this post.

Perhaps it's time to involve your support provider. Or post your complete code, as UCDI suggested.