I am trying to run a macro that has state names in it and there seem to be problems with Oregon because of it's abbreviation. I created a simpler version of the program for testing and I am pasting it below. Can anybody get this to work.
DATA MASTER; INPUT ID $ STATE $ SOURCE $ ;
DATALINES ;
A1 AL PHONE
A2 AL PHONE
A3 KY PHONE
A4 KY PHONE
A5 OR PHONE
A6 OR PHONE
A7 SD PHONE
A8 SD PHONE
A9 VA PHONE
AA VA PHONE
AB VA PHONE
AC FL PHONE
AD FL PHONE
RUN;
%MACRO STATE(ST=);
DATA MASTER1; SET MASTER;
IF STATE="&ST.";
RUN;
%IF &ST=OR OR &ST=VA %THEN %DO;
DATA WORK.Reg1_&ST.; SET WORK.MASTER; RUN; %END;
%IF &ST=FL OR &ST=SD OR &ST=KY %THEN %DO;
DATA WORK.Reg2_&ST.; SET WORK.MASTER; RUN; %END;
%MEND;
%STATE(ST=FL);
%STATE(ST=KY);
%STATE(ST=SD);
%STATE(ST=VA);
%STATE(ST=%BQUOTE(OR));
DATA MASTER; INPUT ID $ STATE $ SOURCE $ ;
DATALINES ;
A1 AL PHONE
A2 AL PHONE
A3 KY PHONE
A4 KY PHONE
A5 OR PHONE
A6 OR PHONE
A7 SD PHONE
A8 SD PHONE
A9 VA PHONE
AA VA PHONE
AB VA PHONE
AC FL PHONE
AD FL PHONE
RUN;
%MACRO STATE(ST=);
DATA MASTER1; SET MASTER;
IF STATE="&ST.";
RUN;
%IF &ST=OR OR &ST=VA %THEN %DO;
DATA WORK.Reg1_&ST.; SET WORK.MASTER; RUN; %END;
%IF &ST=FL OR &ST=SD OR &ST=KY %THEN %DO;
DATA WORK.Reg2_&ST.; SET WORK.MASTER; RUN; %END;
%MEND;
%STATE(ST=FL);
%STATE(ST=KY);
%STATE(ST=SD);
%STATE(ST=VA);
%STATE(ST=%BQUOTE(OR));