In reply to Fatemeh.

You can ask SAS programming questions at the SAS Support Communities. In this case, try
if substr(Statecode,1,1) in ("B" "C" "D") then ...