10-21-2013 01:36 AM
While looking forward to modify and refine a former code I made a variable to be declared on conditions in the following code:
%LET Approach = 'CONTINUOUS';
%LET YrBeg = 2007;
%LET YrEnd = 2013;
%LET MnBeg = 1;
%LET MnEnd = 9;
%LET MajDB = FAQ_NF.ConsNFData;
%LET WhereClauseA = MIS_MONTH BETWEEN MDY(&MnBeg,1,&YrBeg) AND INTNX("MONTH",MDY(&MnEnd,1,&YrEnd),0,"END");
%LET WhereClauseB = (YEAR(MIS_MONTH) = 2007 AND MONTH(MIS_MONTH) = 8) OR (YEAR(MIS_MONTH) = 2008 AND MONTH(MIS_MONTH) = 9);
%LET WhereClauseC = AND ((UPPER(PRODUCT) = "AUTOS") AND (UPPER(PRODUCT_DESC) = "CAF")) OR
((UPPER(PRODUCT) = "AUTOS") AND (UPPER(PRODUCT_DESC) NE "CAF")) OR (UPPER(PRODUCT) = "SBL") OR
(UPPER(PRODUCT) = "PIL") OR (UPPER(PRODUCT) = "SECURED") OR (UPPER(PRODUCT) = "UNSECURED");
LIBNAME FAQ_NF 'F:\eLab\SAS_Experiments\FAQ2';
%IF &Approach = 'CONTINUOUS' %THEN %LET WhereClause = WHERE &WhereClauseA &WhereClauseC;
%ELSE %LET WhereClause = WHERE &WhereClauseB &WhereClauseC;
CREATE TABLE NET_FLOWS AS SELECT
SUM(POS)/1000 AS TOTAL_OS,
COUNT(POS) AS COUNT_OS,
However when I run it the warning Apparent symbolic reference WHERECLAUSE not resolved. is faced.
Any suggestion and advice in this regard shall be highly obliged.
Thanx in advance.
Need further help from the community? Please ask a new question.