DS Server Routine which can give information about the link.

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
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

DS Server Routine which can give information about the link.

Post by Minhajuddin »

Hi there,
I know that we use DSLinkGetInfor() to get the information about the no. of records sent on a link. But I am unable to write a routine which takes the jobname, stage name and link name as parameters and gives the count of rows as the return value.

Please help me on this.
And thanks a lot..
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Use the search facility to get code by others. There are quite a few examples here.
Another place where you can look is, in the source code of the sdk routine, DSRunJob(), under 'Utility'. Look at the section "* Retrieve more information about this job run."
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: DS Server Routine which can give information about the l

Post by chulett »

Minhajuddin wrote:But I am unable to write a routine which takes the jobname, stage name and link name as parameters and gives the count of rows as the return value.
And why is that? What have you tried? Why don't you post your current effort here wrapped in

Code: Select all

 tags and we'll help you 'fix' it.  :wink:
-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 »

My guess is that the routine lacks DSAttachJob() and DSDetachJob() calls. Probably lacks appropriate error handling also. But let's wait till the first attempt is posted.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Minhajuddin
Participant
Posts: 467
Joined: Tue Mar 20, 2007 6:36 am
Location: Chennai
Contact:

Hi I have figured out why it was not working. But, How do we

Post by Minhajuddin »

Hi there,
Thanks for all your support, I have figured out, what was wrong.
I had given DSJ.LINKROWCOUNT as DSJ.LinkRowCount and that is why it wasn't working. BASIC is case sensitive :wink:

Here is the code of the routine which takes three arguments. The arguments are JobName,StageName,LinkName

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H
Job_Handle=DSAttachJob(JobName,DSJ.ERRFATAL)
rc=DSGetLinkInfo(Job_Handle,StageName,LinkName,DSJ.LINKROWCOUNT)
Error_Code=DSDetachJob(Job_Handle)
Ans=rc
Here I have one more thing to do. Instead of returning the value, I think we can write it to a file. But I don't know How to accomplish this. Please Help.
Last edited by Minhajuddin on Sun May 27, 2007 1:16 am, edited 1 time in total.
Minhajuddin

<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What kind of file? You can execute the echo command via DSExecute, or go through the more formal OpenSeq, WriteSeq and CloseSeq statements in DataStage BASIC. Search the forum for a useful routine called OpenSequentialFile().
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post by nick.bond »

In the docs folder of your client install, have a look at the basic.pdf, this can be very useful, particularly in the Quick Reference/Sequential File I/O. This will give you some better ideas about what is available, then you could search the site for the BASIC functions you think you need to use and you'll find examples of others code.
Regards,

Nick.
Post Reply