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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.