BookmarkSubscribeRSS Feed
ErikMetha
Calcite | Level 5

So high level: I am working on a set of SAS programs that pulls from multiple data sources with the intention of calculating rates for a set of products. There are a total of 6 different products, and each category of products has similar calculations, but not exactly the same (the market base rate is different for each, and there are some slight tweaks in the methodologies depending on what product type it is). I come from a object oriented programming perspective, but I realize SAS applications don't really have the same approach as an object oriented programming perspective.

How would I go about building out each program when you're attempting to do the same thing 6 times over? This is what my current set of programs look like, you'll notice there is lots of repetition which feels inefficient, but they are also slightly different and if I coded it all "like" programs into one, it feels really long (not sure if SAS programs should be as long as applications in other languages)

1 REPLY 1
Kurt_Bremser
Super User

Start by viewing your codes side-by-side, so you see which parts are common. Identify what is dynamic, and see if you can parameterize it.

Then you can insert proper %if %then %do - %end blocks to run code parts conditionally.

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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