BookmarkSubscribeRSS Feed
TarunKumar
Pyrite | Level 9

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
2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Ksharp
Super User
Second table is not real dataset . Show your data . SQL , Merge, HashTable ..... all these querying tool can do that.

sas-innovate-2024.png

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.

 

Register now!

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
  • 2 replies
  • 670 views
  • 0 likes
  • 3 in conversation