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
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: