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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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