how to get the metadata details

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
jagan1976
Participant
Posts: 3
Joined: Thu Jun 01, 2006 11:08 pm

how to get the metadata details

Post by jagan1976 »

i wrote a routine to get the maximum value from the source. actually v can use aggregator stage to get this but i need to write routine for this. so do help me out.
Also i am using DSGetLinkMetaData(jobname,linkname) method to get column details. But not able to retrive.


i/p: Desired o/p: O/p i get:

2000.50 25000.50 2000.50
7000.00 25000.50 7000.00
3500.50 - 7000.00
10000.00 - 10000.00
7000.00 - 10000.00
25000.50 - 25000.50
12000.00 - 25000.50

the routine i wrote is:

FUNCTION MaxVal(Arg1)

Common /SDKMaxVal/ curval
Equate RoutineName To 'MaxVal'
Equate NuVal To Arg1

*Loop Until Not(NuVal=@FALSE)
If NuVal<curval Then
Ans=curval End Else
Ans=NuVal
curval=NuVal
*Exit
End
*Repeat


RETURN(ANs)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Why did you bother with a Routine when a stage variable would have done just as well, and would not have introduced COMMON (which has future implications if you ever want to incorporate this server job functionality into a parallel job)?

Regarding DSGetLinkMetaData, do you have the correct arguments? I should have thought you'd need the name of an active stage to which the link is connected. From VLIST, DSGetLinkMetaData has a total of four arguments, which suggests that it requires three input arguments and returns one.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

What you desire with routine .... it does not look logical...
As per you...
1) How you trying to send input to routine?
2) How you will get max value from routine ?

... I think you must go head with aggregator..

Thanks,
Anupam
jagan1976
Participant
Posts: 3
Joined: Thu Jun 01, 2006 11:08 pm

how to get metadata details

Post by jagan1976 »

How to get metadata suing DSgetlinkmetadata? Because but i'm not able 2 compile that routine

sb_akarmarkar wrote:What you desire with routine .... it does not look logical...
As per you...
1) How you trying to send input to routine?
2) How you will get max value from routine ?

... I think you must go head with aggregator..

Thanks,
Anupam
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Re: how to get metadata details

Post by balajisr »

jagan1976 wrote:How to get metadata suing DSgetlinkmetadata? Because but i'm not able 2 compile that routine

sb_akarmarkar wrote:What you desire with routine .... it does not look logical...
As per you...
1) How you trying to send input to routine?
2) How you will get max value from routine ?

... I think you must go head with aggregator..

Thanks,
Anupam
Can you post your error message?

You still have not answered as to why you need a routine?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What is your DEFFUN declaration for DSGetLinkMetaData? This is not catalogued with a "DSU." prefix.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Why do you want to call DSGetLinkMetaData()? What information are you wanting to get at?
Mamu Kim
Post Reply