* Valid for
– Extract
– Replicat
* Syntax
MACRO <macrochar><macro name> # macrochar defaults to pound sign '#' PARAMS (<macrochar><paramname> [, ...]) # Parameters passed to macro BEGIN <macro body> END;
* Example
MACRO #make_date PARAMS (#year, #month, #day) BEGIN @DATE("YYYY-MM-DD", "CC", @IF(#year < 50, 20, 19), "YY", #year, "MM", #month, "DD", #day) END; -- Calls make_date macro from macro MACRO #assign_date PARAMS (#target_col, #year, #month, #day) BEGIN #target_col = #make_date (#year, #month, #day) END;