I want to create a variable who goes frome 1 to 12 based on the date of a test (like first test of the year, second test of the year etc) Here is a little example of what I want it to look like:
Can be solved by sorting data by Cow and JR_Test and a datastep with first and retain to create no_test.
data want;
set have_sorted;
by Cow;
length no_test 8;
retain no_test;
if first.Cow then no_test = 0;
no_test = no_test + 1;
run;
The code is untested, because you haven't provided data in usable form.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
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!