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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.