Page 1 of 1

How to execute a Teradata Macro in a DS job?

Posted: Wed Sep 10, 2008 1:23 am
by varaprasad
Hi,
I want to execute a Teradata parameterized macro in a DataStage job.
The job will have one input sequential file stage from where I will get some values and using them as parameters I have to execute a macro in the target Teradata stage.
How to achieve this?

Posted: Wed Sep 10, 2008 1:39 am
by ray.wurlod
How do you execute Teradata macros in SQL (or in BTEQ)? You use exactly the same techniques - embedding them in SQL statements typically - if using them from DataStage.

Posted: Wed Sep 10, 2008 3:18 am
by varaprasad
Thank you Ray. Infact, I am facing difficulty while passing the parameters. For eg, I can execute the following macro in Teradata as follows:
exec macro_name(param);
In my DataStage job, I will be getting that parameter from a seq file
as a value.
How to deal with this? Plz help.

Posted: Wed Sep 10, 2008 11:20 am
by toshea
Have you tried using the Teradata API stage using the User-defined SQL option? Put your EXECUTE statement in the User-defined SQL.

Posted: Wed Sep 10, 2008 11:53 am
by nishadkapadia
What specific problem you are facing, since if using Teradata API stage and the normal method of mentioning 'USING <<column_name>> , followed by exec <<macro_name>> ( :column_name ).

Do please post any specific message / error you are facing.

resolved

Posted: Thu Sep 11, 2008 4:13 am
by varaprasad
nishadkapadia wrote:What specific problem you are facing, since if using Teradata API stage and the normal method of mentioning 'USING <<column_name>> , followed by exec <<macro_name>> ( :column_name ).

Do please post any specific message / error you are facing.

It was my mistake, It got resolved when I mentioned the datatype in the u/d sql. Thanks Nishad.