Well, the Macro is finished, but somehow the calls of the sub-macros does now work... what did I do wrong? %Macro MultiplevarvaluesFind (source, samevarlist, diffvarlist, resultvarlist, result); proc sql; /* Selektion aller vorhandenen, verschiedenen Paare von samevarlist und diffvarlist */ create table paare as select distinct %BlanksReplaceBycommas(&samevarlist) , %BlanksReplaceBycommas(&diffvarlist) , from &Source; /* Selektion aller Variablen aus der Samevarlist mit mehreren Einträgen in Variablen der Diffvarlist */ create table doppel as select distinct %BlanksReplaceBycommas(&samevarlist) , count(*) as Anzahl from paare group by %BlanksReplaceBycommas(&samevarlist) having Anzahl > 1; /* Selektion aller Variablen aus der Samevarlist, der Diffvarlist und derResultvarlist */ create table &Result as select distinct %StringwblanksInsertcommanprefix(r., &samevarlist) , %StringwblanksInsertcommanprefix (r., &diffvarlist) , %StringwblanksInsertcommanprefix(r., &resultvarlist) from &Source as r inner join doppel on %TablesJoinWvariablesfromstring (doppel, r, &samevarlist); quit; %Mend MultiplevarvaluesFind; LOG: 14 %gaccessible; SYMBOLGEN: Macro variable ACCESSIBLE resolves to ACCESSIBLE 15 %MultiplevarvaluesFind (p_hauptfilter, KontoID System, LimitOgID, system, tempi2); SYMBOLGEN: Macro variable SAMEVARLIST resolves to KontoID System SYMBOLGEN: Macro variable STRING resolves to KontoID System SYMBOLGEN: Macro variable QUOTED resolves to KontoID, System SYMBOLGEN: Macro variable DIFFVARLIST resolves to LimitOgID SYMBOLGEN: Macro variable STRING resolves to LimitOgID SYMBOLGEN: Macro variable QUOTED resolves to LimitOgID NOTE 137-205: Line generated by the invoked macro "MULTIPLEVARVALUESFIND". 15 proc sql; create table paare as select distinct %BlanksReplaceBycommas(&samevarlist) , _ 22 15 ! %BlanksReplaceBycommas(&diffvarlist) , from &Source; create table doppel as select distinct 15 ! %BlanksReplaceBycommas(&samevarlist) , count(*) as 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, CALCULATED, CASE, EXISTS, INPUT, NOT, PUT, SUBSTRING, TRANSLATE, USER, ^, ~. SYMBOLGEN: Macro variable SOURCE resolves to p_hauptfilter NOTE: Line generated by the invoked macro "MULTIPLEVARVALUESFIND". 15 proc sql; create table paare as select distinct %BlanksReplaceBycommas(&samevarlist) , _ 76 15 ! %BlanksReplaceBycommas(&diffvarlist) , from &Source; create table doppel as select distinct 15 ! %BlanksReplaceBycommas(&samevarlist) , count(*) as ERROR 76-322: Syntax error, statement will be ignored. NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements. SYMBOLGEN: Macro variable SAMEVARLIST resolves to KontoID System SYMBOLGEN: Macro variable STRING resolves to KontoID System SYMBOLGEN: Macro variable QUOTED resolves to KontoID, System NOTE 137-205: Line generated by the invoked macro "MULTIPLEVARVALUESFIND". 2 The SAS System 14:35 Friday, June 14, 2013 15 proc sql; create table paare as select distinct %BlanksReplaceBycommas(&samevarlist) , 15 ! %BlanksReplaceBycommas(&diffvarlist) , from &Source; create table doppel as select distinct 15 ! %BlanksReplaceBycommas(&samevarlist) , count(*) as _ 22 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. SYMBOLGEN: Macro variable SAMEVARLIST resolves to KontoID System SYMBOLGEN: Macro variable STRING resolves to KontoID System SYMBOLGEN: Macro variable QUOTED resolves to KontoID, System NOTE 137-205: Line generated by the invoked macro "MULTIPLEVARVALUESFIND". 15 Anzahl from paare group by %BlanksReplaceBycommas(&samevarlist) having Anzahl > 1; create table &Result as ______ 22 15 ! select distinct %StringwblanksInsertcommanprefix(r., &samevarlist) , %StringwblanksInsertcommanprefix (r., &diffvarlist) 15 ! , % ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, ',', -, '.', /, <, <=, <>, =, >, >=, AND, EQ, EQT, GE, GET, GT, GTT, HAVING, LE, LET, LT, LTT, NE, NET, OR, ORDER, ^=, |, ||, ~=. NOTE: Line generated by the invoked macro "MULTIPLEVARVALUESFIND". 15 Anzahl from paare group by %BlanksReplaceBycommas(&samevarlist) having Anzahl > 1; create table &Result as ______ 76 15 ! select distinct %StringwblanksInsertcommanprefix(r., &samevarlist) , %StringwblanksInsertcommanprefix (r., &diffvarlist) 15 ! , % ERROR 76-322: Syntax error, statement will be ignored. SYMBOLGEN: Macro variable RESULT resolves to tempi2 SYMBOLGEN: Macro variable SAMEVARLIST resolves to KontoID System SYMBOLGEN: Macro variable PREFIX resolves to r. SYMBOLGEN: Macro variable STRING resolves to KontoID System SYMBOLGEN: Macro variable PREFIX resolves to r. SYMBOLGEN: Macro variable QUOTED resolves to r.KontoID ,r.System SYMBOLGEN: Macro variable DIFFVARLIST resolves to LimitOgID SYMBOLGEN: Macro variable PREFIX resolves to r. SYMBOLGEN: Macro variable STRING resolves to LimitOgID SYMBOLGEN: Macro variable PREFIX resolves to r. SYMBOLGEN: Macro variable QUOTED resolves to r.LimitOgID SYMBOLGEN: Macro variable RESULTVARLIST resolves to system SYMBOLGEN: Macro variable PREFIX resolves to r. SYMBOLGEN: Macro variable STRING resolves to system SYMBOLGEN: Macro variable PREFIX resolves to r. SYMBOLGEN: Macro variable QUOTED resolves to r.system NOTE 137-205: Line generated by the invoked macro "MULTIPLEVARVALUESFIND". 15 Anzahl from paare group by %BlanksReplaceBycommas(&samevarlist) having Anzahl > 1; create table &Result as 15 ! select distinct %StringwblanksInsertcommanprefix(r., &samevarlist) , %StringwblanksInsertcommanprefix (r., &diffvarlist) _ 22 15 ! , % 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, CALCULATED, CASE, EXISTS, INPUT, NOT, PUT, SUBSTRING, TRANSLATE, USER, ^, ~. SYMBOLGEN: Macro variable SOURCE resolves to p_hauptfilter NOTE: Line generated by the invoked macro "MULTIPLEVARVALUESFIND". 15 Anzahl from paare group by %BlanksReplaceBycommas(&samevarlist) having Anzahl > 1; create table &Result as 15 ! select distinct %StringwblanksInsertcommanprefix(r., &samevarlist) , %StringwblanksInsertcommanprefix (r., &diffvarlist) _ 3 The SAS System 14:35 Friday, June 14, 2013 76 15 ! , % ERROR 76-322: Syntax error, statement will be ignored. SYMBOLGEN: Macro variable SAMEVARLIST resolves to KontoID System SYMBOLGEN: Macro variable STRING resolves to KontoID System SYMBOLGEN: Macro variable N resolves to 2 SYMBOLGEN: Macro variable STRING resolves to KontoID System SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable I resolves to 1 SYMBOLGEN: Macro variable TABLE1 resolves to doppel SYMBOLGEN: Macro variable VAR resolves to KontoID SYMBOLGEN: Macro variable TABLE2 resolves to r SYMBOLGEN: Macro variable VAR resolves to KontoID SYMBOLGEN: Macro variable STRING resolves to KontoID System SYMBOLGEN: Macro variable I resolves to 2 SYMBOLGEN: Macro variable I resolves to 2 SYMBOLGEN: Macro variable QUOTED resolves to doppel.KontoID=r.KontoID SYMBOLGEN: Macro variable TABLE1 resolves to doppel SYMBOLGEN: Macro variable VAR resolves to System SYMBOLGEN: Macro variable TABLE2 resolves to r SYMBOLGEN: Macro variable VAR resolves to System SYMBOLGEN: Macro variable QUOTED resolves to doppel.KontoID=r.KontoID and doppel.System=r.System NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE SQL used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
... View more