stateToCode function

Convert state names to state codes