Varaibles are defined after the macro name and accessed using a colon in front of it
REPLACE MACRO georgexu ( eom_date DATE ,product CHAR(3) ,member_age INT ,enroll_status CHAR) AS ( SELECT * FROM product_table WHERE eom_date>= :eom_date AND product= :product AND member_age> :member_age AND enroll_status= :enroll_status; );
One final quest: Why the SQL below give a error message. I tried it inside "Teradata SQL Assistant"
REPLACE MACRO temp1 (stdt DATE,prod CHAR(3) ) AS (select cx.CIMS_ACCT_KEY , PRDCT_TYP_CDE, ORGNL_SRC_CDE, TRND_MTH_END_DT from v_cdss.VC_FEE_PRDCT_ENRLL_TM_SER as cx where TRND_MTH_END_DT>=:stdt and PRDCT_TYP_CDE=:prod);
________________________________ Code = 3706. 3706: Syntax error: expected something between the word 'prod' and ')'. Output directed to Answer set window
This seems to be a bug in some versions of SQL Assistant, instead of submitting both the CREATE and the EXEC as one block using F5, highlight the CREATE, submit it and then do the same with the EXEC (or simply open another tab for the EXEC).