Thank you, I think I understand it now. The program is pretty long but I will try to give you full details. proc format; value type1 = 'Female' 2 = 'Male' ; run; Here is my program, it is using an excel which has value 1 in the Type Field and min age is also populated with value like >20 macro master; %put &type.; It prints 1 for me select age, type, name, orderdate, code from table P where code in ('5435','4234',786') and %if &type. > ' ' %then AND p.type_c = &type; %if &minage. > ' ' %then AND TRUNC(months_between(orderdate, BIRTH_DATE) / 12) &minage.; and line =1 ); quit; %mend master; However this code errors out when there is no value in the type field ..in the error message it prints missing expression and it prints p.type_c = . Like you both mentioned the >' ' is not working as expected. Type only has value 1 or 2 or blank
... View more