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)

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!

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
  • 755 views
  • 0 likes
  • 2 in conversation