DSGetStageLinks

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
phanee_k
Charter Member
Charter Member
Posts: 68
Joined: Thu Nov 20, 2003 11:02 pm

DSGetStageLinks

Post by phanee_k »

Hi,
I am using DSGetStageInfo for capturing the LinkTypes.
It is returning 1 , 3 as values.

I want to use DSGetStageLinks to capture the link information ( Input Link of the stage , output link of a stage).
When I try to use this function , I am getting an error as DSGetStageLinks never dimensioned.

I understand that the information has to be present in JOBCONTROL.H.

What all necessary steps to be followed to edit the JOBCONTROL.H to update the header information. It is said that we need to update dsapi.H,DSJ_XFUNCS.H , dsrconst.bas files also.

What information has to be passed to these three files so that I can use DSGetStageLinks Function.

Or is there any other way to find the link type(Input/output/reference) linked to a particular stage.


Thanks
Phani
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You ought never to edit any of the header files in DSINCLUDE.

There is no such function as DSGetStageLinks(), which is why the message about array not dimensioned is being generated; because there is no such function, the compiler assumes that a token immediately followed by a left parenthesis is the name of a dimensioned array, then establishes that there is no corresponding DIMENSION statement.

I'm not sure exactly what you are trying to accomplish but chances are that you need some combination of DSGetStageInfo() and DSGetLinkInfo() functions.

DSGetStageInfo(hJob, StageName, DSJ.LINKLIST) will return a list of names of links connected to the stage. Use this name as the third argument to DSGetLinkInfo() to determine specific information about the link. The following code fragment shows how to use the constants declared in JOBCONTROL.H:

Code: Select all

Msg = "Link Row Counts for stage " : StageName
LinkList = DSGetStageInfo(hJob, StageName, DSJ.LINKLIST)
LinkTypes = DSGetStageInfo(hJob, StageName, DSJ.LINKTYPES)
LinkCount = DCount(LinkList, ",")
For LinkNo = 1 To LinkCount
   LinkName = Field(LinkList, ",", LinkNo, 1)
   LinkType = Field("Input|Output|Reference|Reject", "|", Field(LinkTypes, ",", LinkNo, 1), 1)
   RowCount = DSGetLinkInfo(hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
   Msg<-1> = LinkName : TAB : LinkType : TAB : LinkRowCount
Next LinkNo
Call DSLogInfo(Msg, "Link Row Counts")
(I may not have decoded link types correctly; the above was from memory without access to DataStage.)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
phanee_k
Charter Member
Charter Member
Posts: 68
Joined: Thu Nov 20, 2003 11:02 pm

Post by phanee_k »

Thanks Ray.

In the doc, I came across the DSGetStageLinks Function. But it was not dimensioned in the JOBCONTROL.H.So I was unable to use that.
Infact , I came with a similar solution but did not include

LinkType = Field("Input|Output|Reference|Reject", "|", Field(LinkType, ",", LinkCount), 1)

I modified the order and included in the routine.
Getting the right output.

Thanks for your timely inputs.

Thanks,
Phani
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Please advise exactly where you found DSGetStageLinks() function in "the docs". Include the page number as well as the manual name. I'm not aware of this function.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
phanee_k
Charter Member
Charter Member
Posts: 68
Joined: Thu Nov 20, 2003 11:02 pm

Post by phanee_k »

Hi Ray,
Please refer the parallel job advanced developer guide , page number 7-103. It says that

Result = DSGetStageLinks(JobName, StageName, Key)

results in giving the links linked to the stage

Key stands from 1 and 0 where 1 stands for input and 0 for output.

But this is not dimensioned.

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

Post by ArndW »

Phanee,

do 2 things:

1. open up a call at Ascential stating that the DSINCLUDE JOBCONTROL.H is missing the line "DEFFUN DSGetStageLinks(JOB.NAME, STAGE.NAME, LINKMODE)"

2. add that line to your job.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Do mnemonics for LINKMODE also need to be added to JOBCONTROL.H ? (You can tell that I am not doing DataStage things this week.)
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