Passing Parameters to Bteq in Mainframes

General
Enthusiast

Passing Parameters to Bteq in Mainframes

Hi,

I am working with maniframe / teradata .. 

Consider 2 databases "A" and "B".. I need to load table existing in database A using tables present in database B.

I want to parameterize the database name using mainframes. Any Suggestions?

Something like below:

INSERT IN A.TBL1

SEL * FROM B.TBL1 x1

JOIN B.TBL2 x2

ON x1.c = x2.c

JOIN A.TBL3 x3

on x1.a = x3.a

Thanks in Advance