Dear Team,
I have two data set .
table Achivement
location | fee per | casa per |
1 | 50-75% | 150-200% |
2 | 150-200% | 100-150% |
3 | >=200% | 150-200% |
Second table Payout Grid
CASA | 75-100% | 100-150% | 150-200% | >=200% | |
fee | 50-75% | 0 | 0 | 3500 | 5250 |
75-100% | 3000 | 3500 | 4500 | 7250 | |
100-150% | 3500 | 4500 | 5250 | 8000 | |
150-200% | 4500 | 5250 | 7250 | 8500 | |
>=200% | 5250 | 7250 | 8000 | 12500 |
Out put required
location | fee per | casa per | payout |
1 | 50-75% | 150-200% | 3500 |
2 | 150-200% | 100-150% | 5250 |
3 | >=200% | 150-200% | 8000 |
Hi,
You have not given any test data, it is a good idea to post test data in the form of a datastep so that we don't have to guess what your variable names/types are. I have made a guess at what you want below:
proc sql; create table WANT as select A.*, case CASA_PER when "100-150%" then COL2 when "150-200%" then COL3 else . end as PAYOUT from ACHIEVEMENT A left join PAYOUT B on A.FEE_PER=B.CASA; quit;
Note that the COL3 referes to the column labelled100-150% and col3 the next as the labels given are not valid SAS names.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.