I have bi-weekly measurements and in total 23 measurements per country. I want to convert the days of measurements which corresponds to days in months to simply numbering these measurement occasions from 1 to 23 for all countries. I want them to be categorical. Thank you.
location,day
Austria,14
Austria,28
Austria,11
Austria,25
Austria,11
Austria,25
Austria,8
Austria,22
Austria,6
Austria,20
Austria,3
Austria,17
Austria,1
Austria,15
Austria,29
Austria,12
Austria,26
Austria,9
Austria,23
Austria,7
Austria,21
Austria,4
Austria,18
Belgium,14
Belgium,28
Belgium,11
Belgium,25
Belgium,11
Belgium,25
Belgium,8
Belgium,22
Belgium,6
Belgium,20
Belgium,3
Belgium,17
Belgium,1
Belgium,15
Belgium,29
Belgium,12
Belgium,26
Belgium,9
Belgium,23
Belgium,7
Belgium,21
Belgium,4
Belgium,18
Bulgari,14
Bulgari,28
Bulgari,11
Bulgari,25
Bulgari,11
Bulgari,25
Bulgari,8
Bulgari,22
Bulgari,6
Bulgari,20
Bulgari,3
Bulgari,17
Bulgari,1
Bulgari,15
Bulgari,29
Bulgari,12
Bulgari,26
Bulgari,9
Bulgari,23
Bulgari,7
Bulgari,21
Bulgari,4
Bulgari,18
data want;
set have;
by location;
if first.location then counter=0;
counter+1;
run;
I want them to be categorical.
I don't know what 'them to be categorical' means.
@Job04 wrote:
I have bi-weekly measurements and in total 23 measurements per country. I want to convert the days of measurements which corresponds to days in months to simply numbering these measurement occasions from 1 to 23 for all countries. I want them to be categorical. Thank you.
location,day
Austria,14
Austria,28
Austria,11
Austria,25
Austria,11
Austria,25
Austria,8
Austria,22
Austria,6
Austria,20
Austria,3
Austria,17
Austria,1
Austria,15
Austria,29
Austria,12
Austria,26
Austria,9
Austria,23
Austria,7
Austria,21
Austria,4
Austria,18
Belgium,14
Belgium,28
Belgium,11
Belgium,25
Belgium,11
Belgium,25
Belgium,8
Belgium,22
Belgium,6
Belgium,20
Belgium,3
Belgium,17
Belgium,1
Belgium,15
Belgium,29
Belgium,12
Belgium,26
Belgium,9
Belgium,23
Belgium,7
Belgium,21
Belgium,4
Belgium,18
Bulgari,14
Bulgari,28
Bulgari,11
Bulgari,25
Bulgari,11
Bulgari,25
Bulgari,8
Bulgari,22
Bulgari,6
Bulgari,20
Bulgari,3
Bulgari,17
Bulgari,1
Bulgari,15
Bulgari,29
Bulgari,12
Bulgari,26
Bulgari,9
Bulgari,23
Bulgari,7
Bulgari,21
Bulgari,4
Bulgari,18
data want;
set have;
by location;
if first.location then counter=0;
counter+1;
run;
I want them to be categorical.
I don't know what 'them to be categorical' means.
@Job04 wrote:
I have bi-weekly measurements and in total 23 measurements per country. I want to convert the days of measurements which corresponds to days in months to simply numbering these measurement occasions from 1 to 23 for all countries. I want them to be categorical. Thank you.
location,day
Austria,14
Austria,28
Austria,11
Austria,25
Austria,11
Austria,25
Austria,8
Austria,22
Austria,6
Austria,20
Austria,3
Austria,17
Austria,1
Austria,15
Austria,29
Austria,12
Austria,26
Austria,9
Austria,23
Austria,7
Austria,21
Austria,4
Austria,18
Belgium,14
Belgium,28
Belgium,11
Belgium,25
Belgium,11
Belgium,25
Belgium,8
Belgium,22
Belgium,6
Belgium,20
Belgium,3
Belgium,17
Belgium,1
Belgium,15
Belgium,29
Belgium,12
Belgium,26
Belgium,9
Belgium,23
Belgium,7
Belgium,21
Belgium,4
Belgium,18
Bulgari,14
Bulgari,28
Bulgari,11
Bulgari,25
Bulgari,11
Bulgari,25
Bulgari,8
Bulgari,22
Bulgari,6
Bulgari,20
Bulgari,3
Bulgari,17
Bulgari,1
Bulgari,15
Bulgari,29
Bulgari,12
Bulgari,26
Bulgari,9
Bulgari,23
Bulgari,7
Bulgari,21
Bulgari,4
Bulgari,18
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.