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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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