Dear All:
I am trying a IF/THEN statement and I do not seem to get the syntax.
The conditions are as follows
If Year < 2015 and
date not between 24SEP2014 and 08OCT2014 and
Group_ID >15 then
Group_ID = 14
Data want ; set have ;
if Year <2015 and date NE (24SEP2014 le 08OCT2014) and Group_ID > 15 then do;
Group_ID = 14;
run;
I do not seem to get the date statement correctly.
Please help.
Thanks in advance
Your date comparisons are incorrect.
Data want ;
set have ;
if Year <2015
and not ( '24Sep2014'd <= date <= '08Oct2014'd)
and Group_ID > 15
then Group_ID = 14;
run;
@RandyStan wrote:
Dear All:
I am trying a IF/THEN statement and I do not seem to get the syntax.
The conditions are as follows
If Year < 2015 and
date not between 24SEP2014 and 08OCT2014 and
Group_ID >15 then
Group_ID = 14
Data want ; set have ;
if Year <2015 and date NE (24SEP2014 le 08OCT2014) and Group_ID > 15 then do;
Group_ID = 14;
run;
I do not seem to get the date statement correctly.
Please help.
Thanks in advance
Your date comparisons are incorrect.
Data want ;
set have ;
if Year <2015
and not ( '24Sep2014'd <= date <= '08Oct2014'd)
and Group_ID > 15
then Group_ID = 14;
run;
@RandyStan wrote:
Dear All:
I am trying a IF/THEN statement and I do not seem to get the syntax.
The conditions are as follows
If Year < 2015 and
date not between 24SEP2014 and 08OCT2014 and
Group_ID >15 then
Group_ID = 14
Data want ; set have ;
if Year <2015 and date NE (24SEP2014 le 08OCT2014) and Group_ID > 15 then do;
Group_ID = 14;
run;
I do not seem to get the date statement correctly.
Please help.
Thanks in advance
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.