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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.