One of the drawbacks of a language that doesn't require you to declare variables.
It assumes the variable exists and that you'll use it accordingly.
As as far as I know there isn't a way to change the default behaviour. You could try and get around it with by using VVALUEX instead
If vvaluex(id||'1')=vvaluex(id||'2') then do;
If id='A' then C=2;
If id='B' then C=3;
End;
... View more