Hi SAS Forum, I need to categorize the subjects of my large dataset into the cells indicated as xxxx in below table. This table's column variable is "Bal-band" while raw variable is 'beac_band". Bal_band Beac_band 3000+ 1001-3000 <1000 1-200 xxxx xxxx 201-610 xxxx 611-700 700+ 0 or none xxxx First, at the highest level subjects have to be filtered like this. if b_status = 'flcv' and sta_in_12 = '1-30' and use_band ='<100' then do; To create a flag_variable so that I can identify the subjects to be allocated into Cells of our intrest in the above table, I have tried the below code. data want; set have; if b_status = 'flcv' and sta_in_12 = '1-30' and use_band ='<100' then do; if beac_band in ('1-200', ’201-600') and bal_band in ('3000+') or if beac_band in ('1-200') and bal_band in('1001-3000') or if beac_band in ('0 or none') and bal_band in('3000+') then Flag = 'Medium'; end; if …………then do; …….. ……. End; un if …………then do; …….. ……. End; RUN; Question: An error messege comes like this. beac_band in ('580-620') ___________ 22 18 ! and bal_band in('3000+') then Fog = 'Medium'; ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, (, *, **, +, -, /, <, <=, <>, =, >, ><, >=, AND, EQ, GE, GT, IN, LE, LT, MAX, MIN, NE, NG, NL, NOTIN, OR, [, ^=, {, |, ||, ~=. Could you please let me know whether I can or cannot use the above code with several “or” “or” “or”. Thank you for your help. Mirisage
... View more