I have a variable that is missing because are no rows that meet the criteria. I need to put a check in place so if the variable is missing, my code does not fail. here is what I have: proc sql noprint; select name into :TransposedColumnsF separated by ',' from dictionary.columns where libname='EGTASK' and memname ='TRNSTRANSPOSEDFSERIES_MEMBER' AND NAME LIKE 'Column%'; quit; /* transposedColumnF should not return anything*/ /* then I have a case statement to that my query does not fail when the variable does not have any values*/ proc sql; CREATE TABLE EGTASK.MyNewTable AS SELECT case when missing("&TransposedColumnsF.") then '' else (CATX(",",&TransposedColumnsF))LABEL="Disrupted Drugs" end AS 'Disrupted Drugs'n FROM EGTASK.SomeOtherTable t1; quit; /* I get the following error: "ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string....." The code does not fail if &TransposedColumnsF actually gets a value*/
... View more