Page 1 of 1

regarding DSattachjob

Posted: Sat Jan 28, 2006 4:00 am
by raj_konig
Folks,

I am trying to use DSAttachJob Function to attach a job.

"DSAttachJob('test',DSJ.ERRFATAL)" where test is the name of the job.

I even tried appending version to the jobname.

But it is still showing in RED.

Please help me out.

Thanks in aAdvance
Rajesh

Posted: Sat Jan 28, 2006 7:49 am
by kduke
Look at UtilityRunJob in the SDK.

Posted: Sat Jan 28, 2006 9:07 am
by chulett
You are trying to use it where? The fact that it shows in red implies you are in the wrong place or at least on the wrong path. Why don't you let us know what you are trying to accomplish, what your goal in all of this is?

Posted: Sat Jan 28, 2006 9:54 am
by raj_konig
Actually I am trying to get the metadata/ run-time inforamtion of a partiular job. Basically i am setting job_handler for a job and by using this job handler i am trying to get the information of that job.

As of now i am using this in the transformation.

rajesh

Posted: Sat Jan 28, 2006 11:43 am
by ArndW
This routine is not meant to be called for each row in a transform stage; it will show in red in a Transform because it is not defined in the list of valid functions. DSAttachJob and the other DS... functions documented in the BASIC manual are meant to be used from within your own routines.

Posted: Sun Jan 29, 2006 1:57 am
by raj_konig
Thank you for the information.

i am able to call DSAttachjob thru a routine but the retuned value is an integer.

But According to the BASIC guide,
"Do not assume that this value is an integer.", is what is written under the syntax of DSAttachJob

So what i am getting is correct?

Thanks
rajesh

Posted: Sun Jan 29, 2006 2:52 am
by ArndW
Yes, the value is correct; the comment in the documentation is meant to avoid programmers checking the validity of the variable using integer conditions (i.e. FileHandle < 1). You should use the documented methods in the routine description to detect if the call was successful.

Posted: Sun Jan 29, 2006 2:05 pm
by ray.wurlod
It may currently be an integer but "they" reserve the right to change it (for example to a pointer to a structure). Currently it's a row number in a table of pointers to structures.

No, you can not have access to that table.

Treat it like any other opaque variable (file handle, subroutine handle, connection handle, etc.) You are likely to get caught out badly if you rely on the integer nature of a job handle.