DATA Step, Macro, Functions and more

Updating a table

Reply
Contributor
Posts: 22

Updating a table

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
PROC Star
Posts: 7,486

Re: Updating a table

Posted in reply to saslackey
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
Ask a Question
Discussion stats
  • 1 reply
  • 106 views
  • 0 likes
  • 2 in conversation