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-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 lock in 2025 pricing—just $495!

Register now

Develop Code with SAS Studio

Get started using SAS Studio to write, run and debug your SAS programs.

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