Can some one help me onthis.....I have a dataset with three variables ID,DATE1,DATE2..
I should write a query in output those which have difference in dates greater then one.
100010001 2014-08-18 2014-08-18
100010001 2014-08-12 2014-08-12
100010001 2014-09-09 2014-09-02
100010001 2014-09-30 2014-09-23
100010001 2014-10-21 2014-10-14
100010001 2014-11-11 2014-11-04
100010002 2014-09-15 2014-09-15
100010002 2014-09-08 2014-09-08
100010002 2014-10-06 2014-09-29
100010002 2014-10-20 2014-10-29
100010003 2015-03-11 2015-03-11
100010003 2015-03-04 2015-03-04
100010003 2015-04-01 2015-04-25
100010003 2015-04-15 2015-04-20
Thanks in Advance
proc sql;
select * from have
where abs(date1-date2)>1;
quit;
Use Range() function could be another option.
It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.