****************************************************************************************************
****************************************************************************************************
* PROGRAM: addstatetozip3.sas
* Created (mm/dd/yyyy): 08/09/2017
*--------------------------------------------------------------------------------------------------
* PURPOSE: The macro adds state based on 3 Digit Zip Code.
*--------------------------------------------------------------------------------------------------
* Sentinel Coordinating Center
* info@sentinelsystem.org
***************************************************************************************************;
%macro addstatetozip3(data=);
%put =====> MACRO CALLED: addstatetozip3;
/* recode the following 3 digit zips:
These 3 digit zip codes correspond to multiple states as of 1/1/2017. If new discordant states
arise, a warning will be written to the log. The decision was made to assign to 1 state */
if zip3 = '063' then statecode = 'CT';
if zip3 = '205' then statecode = 'DC';
if zip3 = '739' then statecode = 'OK';
if zip3 = '834' then statecode = 'ID';
if zip3 = '969' then statecode = 'GU';
create table ziplookup as
select distinct zip3, statecode