BookmarkSubscribeRSS Feed
saslackey
Calcite | Level 5
this is my table(a small example) my table has around 25000 rows

id statename associationname code price
1 texas TX 3435 234
2 alabama FLC 2342 345
3 alabama FLB 35443 345
4 alabama ALC 3445 356

Now i want to make changes such that if statename= alabama and associationname=FLC

i want to change associationname to AL

pls help thanks in advance
1 REPLY 1
art297
Opal | Level 21
You may have to use the strip and upper functions in the event that your data has extra spaces or case difference but, otherwise, you may only need something like:
[pre]
data want;
set have;
if statename eq "alabama" and associationname eq "FLC"
then associationname="AL";
run;
[/pre]
HTH,
Art

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1097 views
  • 0 likes
  • 2 in conversation