Hi, I’m trying to run the following macro from this SAS support paper on flagging healthcare claims using SAS 9.4 (TS1M3)(https://support.sas.com/resources/papers/proceedings15/1340-2015.pdf 😞 %macro flag(codetype, flagtype); proc sql; select quote(code) into :codelist separated by "," from CODES where codetype="&codetype" and flagtype="&flagtype"; quit; data CLAIMS; set CLAIMS; if &codetype.1 in (&codelist) then _&flagtype=1; run; %mend; %flag(hcpcs, biopsy); *flag biopsy; I have my datasets (CLAIMS and CODES) set up as specified in the paper with the only notable difference being my data contains multiple claims per patient; but I'm not sure this should matter. I keep getting the following error when I try running the code and have tried the almost all suggestions for ERROR 22-322 listed in SAS community posts. None of them have resolved this error. Does anyone know what is wrong with this code? SAS log after I run this macro: 2653 options MLOGIC; 2654 %flag(hcpcs, biopsy); MLOGIC(FLAG): Beginning execution. MLOGIC(FLAG): Parameter CODETYPE has value hcpcs MLOGIC(FLAG): Parameter FLAGTYPE has value biopsy SYMBOLGEN: Macro variable CODETYPE resolves to hcpcs SYMBOLGEN: Macro variable FLAGTYPE resolves to biopsy NOTE: No rows were selected. NOTE: PROCEDURE SQL used (Total process time): real time 0.03 seconds cpu time 0.01 seconds SYMBOLGEN: Macro variable CODETYPE resolves to hcpcs NOTE: Line generated by the invoked macro "FLAG". 2 (&codelist) then _flagtype=1; run; - 22 76 WARNING: Apparent symbolic reference CODELIST not resolved. ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant, a missing value, iterator, (. ERROR 76-322: Syntax error, statement will be ignored. Thank you for your help!
... View more