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

I am trying to update a table in SAS with a new variable. I want the salary column to be multiplied by different numbers depending on position. This is the code I have been using, but it giving me an error saying that modsal isn't a variable and also giving an error when I am trying to set the position to the number I am multiplying by saying there is a syntax error. 

 

PROC sql;
UPDATE work.baseball2
SET modsal = salary*case label ="Modern Salary Equivelent"
WHEN position = 'C' then 5
WHEN position = ('1B','2B','SS','3B') then 6
WHEN position = ('RF','LF','CF','DH') then 8
END;
1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

this part definitely needs correction

 

to 

 

WHEN position = 'C' then 5
WHEN position in ('1B','2B','SS','3B') then 6
WHEN position in  ('RF','LF','CF','DH') then 8

View solution in original post

1 REPLY 1
novinosrin
Tourmaline | Level 20

this part definitely needs correction

 

to 

 

WHEN position = 'C' then 5
WHEN position in ('1B','2B','SS','3B') then 6
WHEN position in  ('RF','LF','CF','DH') then 8

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