Hi all,
I have a masterlist with 2 years of data... I need to segment data for some months and check it against the last 6 or 12 months of activity to mark how many are repeats vs net new
What i have so far is this:
Isolate the month i want. the list has a variable run_date which has the 1st day of a month as the run date.
So jan = 1/1/2019
feb = 2/1/2019
You may want to examine the dates that the month difference changes in the below code. Month1 does not use the 'C' option in intck and Month2 does.
data example; do date = '31DEC2018'd to '01Jul2019'd; months1 = intck('month',date,'01Jul2019'd); months2 = intck('month',date,'01Jul2019'd,'C'); output; end; format date date9.; run;
It may be all you need to do is drop the 'C' from intck function call.
You may want to examine the dates that the month difference changes in the below code. Month1 does not use the 'C' option in intck and Month2 does.
data example; do date = '31DEC2018'd to '01Jul2019'd; months1 = intck('month',date,'01Jul2019'd); months2 = intck('month',date,'01Jul2019'd,'C'); output; end; format date date9.; run;
It may be all you need to do is drop the 'C' from intck function call.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.