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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.