SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
cho16
Obsidian | Level 7

Hi Team,

 

I am trying to run the below macro code and it gives an error.

 

I couldnt figure out the error. Could you please help me

 

%macro roster;

proc sql;

create table NON_RESPONDERS_BULLET_7_P as

select t1.* from DSS_HRA_Healthfirst_Roster t1

where (t1.EFFECTIVE_DATE < intnx('year',today(),-1,'S') OR t1.EFFECTIVE_DATE > intnx('year',today(),-1,'E'))

and (t1.PRODUCT_PBP CONTAINS 'LIP1' OR t1.PRODUCT_PBP CONTAINS 'MAX1')

and ((t1.LAST_SURVEY_DATE1 BETWEEN intnx('year',&start3mnth,-15) and intnx('year',&end3month,-15))

%do i = -14 %to -2;

or (t1.LAST_SURVEY_DATE1 BETWEEN intnx('year',&start3mnth,&i) and intnx('year',&end3month,&i))

%end;

or (t1.LAST_SURVEY_DATE1 BETWEEN intnx('year',&start3mnth,&i) and intnx('year',&end3month,&i)));

quit;

%mend roster;

 

%roster

 

ERROR 22-322: Syntax error, expecting one of the following: !, !!, &, *, **, +, ',', -, /, <,
              <=, <>, =, >, >=, ?, AND, CONTAINS, EQ, EQT, GE, GET, GT, GTT, LE, LET, LIKE,
              LT, LTT, NE, NET, OR, ^=, |, ||, ~=.

 

Thanks

 

1 REPLY 1
ballardw
Super User

Please refrain from posting the same question in multiple locations. If you respond to a question about the issue in one thread then that information is NOT available to others that may be looking at the other version.

sas-innovate-white.png

Join us for our biggest event of the year!

Four days of inspiring keynotes, product reveals, hands-on learning opportunities, deep-dive demos, and peer-led breakouts. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 905 views
  • 0 likes
  • 2 in conversation