I really like collapsing code in the Editor in SEG, but there are certain aspects of it that are suboptimal. For example, I like to put a 1-line comment as a header just above a whole set of steps. I'd like to still be able to see the header even when the code is collapsed, but when you collapse a step, any empty lines or comments just before the step also get hidden. Is there a way to change this feature? Or is there a workaround to trick the Editor into not collapsing certain comments? Any suggestions would be appreciated.
Note: I've already taken a look at Tools > Options > SAS Programs > Enhanced Editor Options, but the Collapsible Code settings there seem fairly rudimentary.
Hello, @Paul_de_Barros,
I have a simple work-around for that: Put an extra semi colon after each such comment. Try it with the below code.
Jim
** This is an explanatory comment **;;
PROC SQL;
SELECT COUNT(*)
FROM SASHELP.CARS;
RUN;
/* This is another explanatory comment */;
DATA _NULL_;
Answer=42;
PUTLOG "NOTE: " Answer=;
STOP;
RUN;
Hello, @Paul_de_Barros,
I have a simple work-around for that: Put an extra semi colon after each such comment. Try it with the below code.
Jim
** This is an explanatory comment **;;
PROC SQL;
SELECT COUNT(*)
FROM SASHELP.CARS;
RUN;
/* This is another explanatory comment */;
DATA _NULL_;
Answer=42;
PUTLOG "NOTE: " Answer=;
STOP;
RUN;
Hi! I am new with SAS and I am also using SEG.
I noticed this option of collapsing and expanding SAS steps in the program editor.
Although I haven't figured out yet, what is the use of it?
Is it just to make the code more tidy? Or?
Also why can't I run my steps when they are collapsed, is there some shortcut to it, apart from F3?
Thanks!
@MariannaKotopou Code collapse is just to make things easier to read. If you highlight the collapsed code, you can still run it with the Run Selection button, though I haven't tried it with keyboard shortcuts.
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.
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.
Ready to level-up your skills? Choose your own adventure.