10-14-2011 05:51 AM
I am getting an error while calling the macro funcion in my proc SQL.
This query is working fine when i remove the &MAC_Markup_Value. part.
Can someone please help me to understand the error message and help me to resolve this.
%Let MAC_Markup_Value = 1.18;
CREATE TABLE Claims_Join AS
macunitcost_num * qty * &MAC_Markup_Value. as MAC
FROM WORK.MAHEC_Claims AS t1
LEFT JOIN WORK.SPECIALTY AS t2 ON (t1.ndc = t2.NDC)
WARNING: Apparent symbolic reference MAC_MARKUP_VALUE not resolved.
23 macunitcost_num * qty * &MAC_Markup_Value. as MAC
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, a numeric constant, a datetime constant,
a missing value, BTRIM, INPUT, PUT, SUBSTRING, USER.
ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, <, <=, <>, =, >, >=, ?, AND, AS,
CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE, LT, LTT, NE, NET, OR, ^=, |, ||, ~=.
10-14-2011 01:56 PM
I also suggest that routinely ending your macro variable calls with the period is not best practice. You may run into hard to diagnose issues if you get involved with complex macro resolution.