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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2910 views
  • 6 likes
  • 3 in conversation