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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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
  • 1 reply
  • 411 views
  • 0 likes
  • 2 in conversation