BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Job04
Quartz | Level 8

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

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
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.

 

Spoiler

@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


View solution in original post

1 REPLY 1
Reeza
Super User
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.

 

Spoiler

@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


SAS Innovate 2025: Register Now

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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 327 views
  • 0 likes
  • 2 in conversation