Page 1 of 2

Link Names

Posted: Mon Jul 07, 2008 4:27 pm
by ririr
Hello Gurus,

I need help in extracting the Input and Output link names for a job using the Universe stage.

sequnetial file stage---> transformstage1 ---> transformstage2 ---> DRS stage


Any help with this is appreciated!

Posted: Mon Jul 07, 2008 5:12 pm
by chulett
You're going to need to be more explicit. And what purpose does your example job serve? It is an example of what, in other words.

Posted: Mon Jul 07, 2008 5:39 pm
by ray.wurlod
I can not see a UniVerse stage in the job design you documented, am I missing something?

The usual, and officially documented, approach to get link names is to invoke the DSGetStageInfo() function in a routine.

Posted: Tue Jul 08, 2008 8:48 am
by ririr
I'd like to extract the Input/Output link names in the same order as they are designed for each Stage in a give Job.

example:

sequential file-->transformerstage1(XX)-->transformerstage2(YY)-->DRS


Sequential File Link is Input to transformerstage1
XX is the Output Link from transformerstage1
XX is the Input link to transformerstage2
YY is Output link from transformerstage2
YY is the Input link to DRS stage

DSGetStageInfo returns the link names when it is called within the job itself.

Ideally, I'd like the Universe stage extract the link names (input and output) in the same order as designed.

Posted: Tue Jul 08, 2008 8:57 am
by chulett
Looks like a two-part effort. First use DSGetJobInfo with an InfoType of DSJ.JOBFULLSTAGELIST, then loop through the results and call DSGetStageInfo with DSJ.LINKLIST.

Posted: Tue Jul 08, 2008 9:32 am
by ririr
Chulett,

Thanks for your quick response.

I am calling DSGetStageInfo function in a routine just to test it. I passed the Job Name for Arg1, for Arg2 Stage Name and Arg3 Info Type (DSJ.LINKLIST)

Call DSGetStageInfo (Result, Arg1, Arg2,Arg3)
Ans=Result

The value in the Result is a "-1".

But, when I call the DSGetStageInfo funciton within the job and pass DSJ.ME as "Job Name", DSJ.ME as the "Stage Name" and "DSJ.LINKLIST" as the Info Type it returns the input/output links seperated by commas only for that particular stage.

What I am trying to achieve here is to get all the input/output links in the same sequence as designed for a given stage within a job. I was able to extract Job and Stage names from DS_JOBS and DS_JOBOBJECTS files for all the jobs in my project.

Any help with this is appreciated!

Posted: Tue Jul 08, 2008 9:39 am
by chulett
"Arg1" is not the job name but rather a job handle that you need to establish and DSJ.ME is short for 'the current job'. See DSAttachJob and DSDetachJob.

Posted: Tue Jul 08, 2008 10:18 am
by ririr
Chulett,

Can you pls. shed some light for establishing a Job Handle to a given job?

I tried calling the DSAttachJob function in a routine just to test it.

Call DSAttachJob (Job_Handle,Arg1, Arg2)

Ans=Job_Handle

I passed Job Name for Arg1 and DSJ.ERRNONE and the Job_Handle returns an Integer "0".

Any help is appreciated!

Posted: Tue Jul 08, 2008 10:32 am
by ArndW
DSAttachJob() is a function, not a subroutine. It won't compile or run with a CALL.
Use "JobHandle = DSAttachJob(Arg1,Arg2)"

Posted: Tue Jul 08, 2008 10:32 am
by chulett

Code: Select all

jHandle=DSAttachJob(Arg1,Arg2)
Arg1 = Job Name
Arg2 = Error Level

Posted: Tue Jul 08, 2008 11:28 am
by ririr
The below code still returns an integer "0" in jHandle. when I pass the Job Name and Error Level as either DSJ.ERRFATAL or DSJ.ERRWARN.

$INCLUDE DSINCLUDE JOBCONTROL.H
jHandle=DSAttachJob(Arg1,Arg2)
Ans=jHandle

Posted: Tue Jul 08, 2008 11:39 am
by chulett
I use DSJ.ERRNONE but that choice doesn't affect the attachment, only subsequent use of the handle. Have you tried actually using the handle in subsequent steps? From the docs:
JobHandle is the name of a variable to hold the return value which is subsequently used by any other function or routine when referring to the job. Do not assume that this value is an integer.

Posted: Tue Jul 08, 2008 5:03 pm
by ririr
chulett wrote:I use DSJ.ERRNONE but that choice doesn't affect the attachment, only subsequent use of the handle. Have you tried actually using the handle in subsequent steps? From the docs:
JobHandle is the name of a variable to hold the return value which is subsequently used by any other function or routine when referring to the job. Do not assume that this value is an integer.
Still cannot resolve the issue. Wondering whether is it possible to get all the input/output link names in the same sequence for all the jobs in a given project.

Posted: Tue Jul 08, 2008 5:03 pm
by ririr
chulett wrote:I use DSJ.ERRNONE but that choice doesn't affect the attachment, only subsequent use of the handle. Have you tried actually using the handle in subsequent steps? From the docs:
JobHandle is the name of a variable to hold the return value which is subsequently used by any other function or routine when referring to the job. Do not assume that this value is an integer.
Still cannot resolve the issue. Wondering whether is it possible to get all the input/output link names in the same sequence for all the jobs in a given project.

Posted: Tue Jul 08, 2008 5:34 pm
by ray.wurlod
What is the value of Arg1?

Don't assume, check - maybe using DSLogInfo().

If the job name is not spelled and cased correctly, DSAttachJob() will fail to attach the job.