dimanche 5 juin 2016

Automating IF and then statement in sas using macro in SAS

I have a data where I have various types of loan descriptions, there are at least 100 of them.

I have to categorise them into various buckets using if and then function. Please have a look at the data for reference

data des;     
    set desc;      
if loan_desc in ('home_loan','auto_loan')then product_summary ='Loan';     
if loan_desc in ('Multi') then product_summary='Multi options';     
run;

For illustration I have shown it just for two loan description, but i have around 1000 of different loan_descr that I need to categorise into different buckets.

How can I categorise these loan descriptions in different buckets without writing the product summary and the loan_desc again and again in the code which is making it very lengthy and time consuming

Please help!

Aucun commentaire:

Enregistrer un commentaire