BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SAS-Nutzer
Fluorite | Level 6

I inherited an extensive SAS-program that uses a lot of Macro %if...%else, %do...%end etc. blocks.

 

Since it is not well formatted, it is very hard to understand what block includes what and which %end or %else belongs to which %if or %do. In most programming languages / IDEs, there is a way to click on an "if" and jump to the corresponding "else" or highlight it. Is this possible in SAS EG with macro code like %if and %else?

I already tried auto-formatting, but with limited success. Is there a way to visually highlight the corresponding %end of a %if / %do, or to click on the beginning %if of a block and jump to the corresponding %end ? 

1 ACCEPTED SOLUTION

Accepted Solutions
Sajid01
Meteorite | Level 14

While in the SAS EG it is not possible to have what you want, but code formatting and with little effort your issue should be resolved.
You can format code in the SAS Enterprise guide using CTRL+I (OR Select EDIT in the main menu, then format code from drop down).

View solution in original post

1 REPLY 1
Sajid01
Meteorite | Level 14

While in the SAS EG it is not possible to have what you want, but code formatting and with little effort your issue should be resolved.
You can format code in the SAS Enterprise guide using CTRL+I (OR Select EDIT in the main menu, then format code from drop down).

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

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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