I'm needing to use a termination date in date9. format to join to another table that has monthly records with a time_id also in date9. format. The problem is that the time_id always references the last day of the month (31JAN2015, 28FEB2015, etc.) and my termination date can be any day of the month. I just need to use a member_id in combination with the termination month/year to join to the other table with member_id and month/year, disregarding day of the month. SUBSTR requires characters and the dates are numeric. I tried using MONTH(TERM_DT) but that gives the number of the month and I need the 3 character format for month. Any other ideas?
Thanks - this worked perfectly! I didn't know just how versatile intnx was...
It would be better to post some data to explain your questions. GROUPFORMAT + FORMAT is for such scenario .
data want;
merge a b;
by date groupformat ;
format date monyy.;
run;
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.