BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Paul_de_Barros
Obsidian | Level 7

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.

1 ACCEPTED SOLUTION

Accepted Solutions
jimbarbour
Meteorite | Level 14

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;

View solution in original post

3 REPLIES 3
jimbarbour
Meteorite | Level 14

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;
MariannaKotopou
Calcite | Level 5

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! 

Paul_de_Barros
Obsidian | Level 7

@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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3 replies
  • 3610 views
  • 6 likes
  • 3 in conversation