Hello, in the SAS Street Geocoding guide, it suggests removing extraneous information to improve street geocoding. I would like to remove the apartment or lot number at the end of the address string e.g., “1122 Main St Apt xxx” or “1122 Main St Lot xxx”, resulting in "1122 Main St" to clean these data in preparation for street geocoding. I’m having difficulty with SAS code (below) to do this. Please advise? Thx!
data Test ; set Data1 (keep=address city zipcode state) ;
SUB = '<Apt>';
address = transtrn(STR,SUB,trimn(''));
run;