Page 1 of 1

how to get the metadata details

Posted: Mon Jun 05, 2006 11:51 pm
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)

Posted: Tue Jun 06, 2006 12:17 am
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.

Posted: Tue Jun 06, 2006 12:32 am
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

how to get metadata details

Posted: Tue Jun 06, 2006 3:24 am
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

Re: how to get metadata details

Posted: Tue Jun 06, 2006 5:27 am
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?

Posted: Tue Jun 06, 2006 6:12 am
by ray.wurlod
What is your DEFFUN declaration for DSGetLinkMetaData? This is not catalogued with a "DSU." prefix.

Posted: Tue Jun 06, 2006 6:42 am
by kduke
Why do you want to call DSGetLinkMetaData()? What information are you wanting to get at?