BookmarkSubscribeRSS Feed
RobF
Quartz | Level 8

I liberally use headers & comments in my SAS code, however when my programs reach lengths of thousands of lines I find myself losing track of the location of procedures and macros.

Is there a way to create a "table of contents" at the top of my SAS code that lists line numbers or, better yet, contains active hyperlinks within my program?

4 REPLIES 4
Reeza
Super User

The other general solution is to create multiple programs and %include them instead of having one giant program. 

RobF
Quartz | Level 8

Thanks, that's a good idea - although I may end up with a lot of separate programs tied together by my main table of contents program. I'd have to stay on top of file organization.

Peter_C
Rhodochrosite | Level 12

Although it is not exactly what you want, when coding in the enhanced efitor (e.g. in EG) you can collapse all data and proc steps and macros to just one line. See the effect with keyboard combination

ctrl+alt +numblock - (minus key)

Reinstate with ctrl+alt (num+)

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 4 replies
  • 1558 views
  • 2 likes
  • 3 in conversation