Get Link Direction within Job via Routine

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

Post Reply
nishadkapadia
Charter Member
Charter Member
Posts: 47
Joined: Fri Mar 18, 2005 5:59 am

Get Link Direction within Job via Routine

Post by nishadkapadia »

Hi,

I am aware that one can get Link Names attached with the stage. However, how does one get Link Direction.

Code: Select all

Seq_1 --> Trfm(Transformer)  --> Seq_2
If one wants to know that transformer has only one o/p link to Seq_2 and one i/p link from Seq_1. How does one find the direction of the link name.
I can find the oppsite stage name at the end of the link.

If i have missed while searching the forum, it would be wonderful if one could post the url.

Thanks in anticipation,
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The link "direction" can be retrieved using the DSGetStageInfo() routine call and using the DSJ.LINKTYPES code.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Good luck because I don't think it has been posted. It is very complex to tie the ends together especially if there is no transform in between. You need to know a lot about the repository tables. I don't think there is any API call to get this.
Mamu Kim
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

By the way the stage types are not very useful either. Does CODBCInput actually help you. The Input means it is output to an ODBC table.
Mamu Kim
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

By using DSGetStageInfo() and DSGetLinkInfo() calls and a bit of programming logic you can get the link "direction" information. As Kim stated it is not straightforward but the information is there using the API calls.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You do need to be alert to the fact to which Kim alluded, namely that "Input" and "Output" are stage-centric terms. A stage that reads data from a persistent store will have an output link, whereas a stage that writes data to persistent storage will have an input link.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nishadkapadia
Charter Member
Charter Member
Posts: 47
Joined: Fri Mar 18, 2005 5:59 am

Post by nishadkapadia »

Thank you all, will try and post my results here.
nishadkapadia
Charter Member
Charter Member
Posts: 47
Joined: Fri Mar 18, 2005 5:59 am

Post by nishadkapadia »

Hi,

One can use LinkTypes as suggested. It does work with Active Stages, however if there is a job with Passive stages only, it is not possible using LinkTypes. That is my understanding.

The other route which i tried was using Oletypes for ObjectNames,
which as everybody had explained how to make meaning of it.

However, if just select name,oletype from ds_jobobjects one could
find the meaning however to relate it all only using that much information
was not possible by me. Maybe i am missing something here also. :oops:

I just used LinkTypes which worked fine. However, for jobs with only passive stages (luckily there were only a couple) wrote specifically to handle these.

Thank you all once again.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

nishadkapadia wrote:I just used LinkTypes which worked fine. However, for jobs with only passive stages (luckily there were only a couple) wrote specifically to handle these.
Add one.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply