BookmarkSubscribeRSS Feed
claudiopcjr
Fluorite | Level 6

Hi everyone,

 

I'm running a macro that aims to find the best the best buckets for intervals of rating corporates companies that has a probability of default. Sadly I can't provide the macro here (because corporate policies and also because isn't something that I can do any changes) but I have a few parameters that I can minimally handle the provided results. Those are, the min percentage of of default on each intervals of rating and the percentage of total clients on each bucket.

 

These two parameters can change from 0.05% until 100%.

 

What i'm intending is to find the best combination of those two percentage numbers in a macro.

 

In other posts is easy to find solutions using macros that uses this kind of logic:

 

%do i = 1 %to &k ;
end ;
%end ;

 

But not for percentage numbers.

 

Can anyone help me how to handle that ?

 

Thanks in advance. 

1 REPLY 1
Patrick
Opal | Level 21

Does below do what you need?

%macro demo(start,stop,inc=0.01 );
  %let i=&start;
  %do %while(%sysevalf(&i<=&stop));
    %put &=i;
    %let i=%sysevalf(&i+&inc);
  %end;

%mend;
%demo(0.05, 100, inc=0.05)

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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