Link Names

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

ririr
Participant
Posts: 84
Joined: Sun Apr 04, 2004 8:59 pm

Link Names

Post 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!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ririr
Participant
Posts: 84
Joined: Sun Apr 04, 2004 8:59 pm

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ririr
Participant
Posts: 84
Joined: Sun Apr 04, 2004 8:59 pm

Post 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!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ririr
Participant
Posts: 84
Joined: Sun Apr 04, 2004 8:59 pm

Post 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!
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

DSAttachJob() is a function, not a subroutine. It won't compile or run with a CALL.
Use "JobHandle = DSAttachJob(Arg1,Arg2)"
Last edited by ArndW on Tue Jul 08, 2008 10:33 am, edited 1 time in total.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Code: Select all

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

"You can never have too many knives" -- Logan Nine Fingers
ririr
Participant
Posts: 84
Joined: Sun Apr 04, 2004 8:59 pm

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ririr
Participant
Posts: 84
Joined: Sun Apr 04, 2004 8:59 pm

Post 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.
ririr
Participant
Posts: 84
Joined: Sun Apr 04, 2004 8:59 pm

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply