Hi:
I believe you are getting that message because you do not have a space:
[pre]
if cod=('21'and '31');
--
[/pre]
between the ' and the 'a' for
and
However, it is probably a moot point, since the syntax of your IF statement is incorrect. For some examples of how to code an IF statement, refer to the documentation examples found here:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000201978.htm
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202239.htm
http://support.sas.com/documentation/cdl/en/lrcon/62955/HTML/default/viewer.htm#a000780367.htm
For one thing, it would be impossible for 1 variable to hold 2 values on a single observation so you would never find an observation where the value for COD was both '21' AND '31'. So I suspect you want to subset those observations where the value for code is
either '21'
or is '31'.
You could use either of these forms of subsetting IF:
[pre]
if cod='21' or cod='31';
OR
if cod in ('21', '31');
[/pre]
cynthia