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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.