How to execute a Teradata Macro in a DS job?

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
varaprasad
Premium Member
Premium Member
Posts: 34
Joined: Fri May 16, 2008 6:24 am

How to execute a Teradata Macro in a DS job?

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
varaprasad
Premium Member
Premium Member
Posts: 34
Joined: Fri May 16, 2008 6:24 am

Post 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.
toshea
Participant
Posts: 79
Joined: Thu Aug 14, 2008 6:46 pm

Post 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.
nishadkapadia
Charter Member
Charter Member
Posts: 47
Joined: Fri Mar 18, 2005 5:59 am

Post 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.
varaprasad
Premium Member
Premium Member
Posts: 34
Joined: Fri May 16, 2008 6:24 am

resolved

Post 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.
Post Reply