# SAS program formatting question

**URL:** <https://boards.straightdope.com/t/sas-program-formatting-question/613529>\
**Category:** Factual Questions\
**Created:** [February 21, 2012, 3:28pm UTC](https://boards.straightdope.com/t/sas-program-formatting-question/613529 "2012-02-21T15:28:15Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![BetsQ](https://avatars.discourse-cdn.com/v4/letter/b/fbc32d/32.png) [@BetsQ](https://boards.straightdope.com/u/BetsQ)\
**Post date:** [February 21, 2012, 3:28pm UTC](https://boards.straightdope.com/t/sas-program-formatting-question/613529/1 "2012-02-21T15:28:15Z")

</div>

Surely we have some SAS folks out there, right?

I have inherited a set of programs created by someone else. He has used the occasional horizontal line to visually separate sections of the program. This seems like a very handy tool, but I can’t figure out how to replicate it. Anyone know how it’s done?

---

<div class="post-metadata">

**Author:** ![AllShookDown](https://avatars.discourse-cdn.com/v4/letter/a/d9b06d/32.png) [@AllShookDown](https://boards.straightdope.com/u/AllShookDown)\
**Post date:** [February 21, 2012, 3:37pm UTC](https://boards.straightdope.com/t/sas-program-formatting-question/613529/2 "2012-02-21T15:37:54Z")

</div>

Place an asterisk, then a series of underscores or dashes or asterisks to go across the screen and end it with a semi-colon.

Or put a forward slash, then an asterisk, then your series of whatevers, then another asterisk, then another forward slash.

\*\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_;

/_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\__/

\*------------------------------;

/_-------------------------------_/

/\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*/

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*;

You can use the /\* \*/ or \* ; combination to make comments in your programs, not only dividing lines.

---

<div class="post-metadata">

**Author:** ![mcgato](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@mcgato](https://boards.straightdope.com/u/mcgato)\
**Post date:** [February 21, 2012, 6:41pm UTC](https://boards.straightdope.com/t/sas-program-formatting-question/613529/3 "2012-02-21T18:41:08Z")

</div>

With my version of SAS (9.1) and using the Enhanced Editor, SAS automatically denotes sections of code with a horizontal line at the end of the code. There is also an ‘-’ in a box at the beginning of the code that allows that section of code to be collapsed.

Enabling that appears to be in the Tools–\>Options–\>Enhanced Editor. Then on the General tab, there is a box to enable “Collapsible code sections” and “Show section lines in text.”

Not sure if that is what you were looking for.

---

<div class="post-metadata">

**Author:** ![Kimballkid](https://avatars.discourse-cdn.com/v4/letter/k/b5a626/32.png) [@Kimballkid](https://boards.straightdope.com/u/Kimballkid)\
**Post date:** [February 21, 2012, 9:33pm UTC](https://boards.straightdope.com/t/sas-program-formatting-question/613529/4 "2012-02-21T21:33:34Z")

</div>

I use SAS 9.2 and it does what **mcgato** said. It must be a default though as I’ve never had to enable it.

---

<div class="post-metadata">

**Author:** ![Napier](https://avatars.discourse-cdn.com/v4/letter/n/ce73a5/32.png) [@Napier](https://boards.straightdope.com/u/Napier)\
**Post date:** [February 21, 2012, 10:49pm UTC](https://boards.straightdope.com/t/sas-program-formatting-question/613529/5 "2012-02-21T22:49:26Z")

</div>

Ditto. I think it does this immediately after any run; or options; or %mend; statement.

---

<div class="post-metadata">

**Author:** ![conway](https://avatars.discourse-cdn.com/v4/letter/c/ec9cab/32.png) [@conway](https://boards.straightdope.com/u/conway)\
**Post date:** [February 21, 2012, 11:01pm UTC](https://boards.straightdope.com/t/sas-program-formatting-question/613529/6 "2012-02-21T23:01:01Z")

</div>

Just in case, you can turn this on (in 9.2) by going to Tools-\>Options-\>Enhanced Editor. Under the General tab make sure “Collapsible code sections” and “Show section lines in text” are both checked.

---

<div class="post-metadata">

**Author:** ![Andy\_L](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Andy\_L](https://boards.straightdope.com/u/Andy_L)\
**Post date:** [February 21, 2012, 11:40pm UTC](https://boards.straightdope.com/t/sas-program-formatting-question/613529/7 "2012-02-21T23:40:46Z")

</div>

> [@conway](#):
>
> Just in case, you can turn this on (in 9.2) by going to Tools-\>Options-\>Enhanced Editor. Under the General tab make sure “Collapsible code sections” and “Show section lines in text” are both checked.

I don’t know why my code doesn’t do that automatically, but I’m going to look into it tomorrow, because collapsible code is very helpful. Years ago, I used a editor for the obscure language OCCAM which had a “folding” editor - every structure (if, do, etc.) could be “folded” out of the way so that higher levels of organization could be more easily seen, or unfolded to look at the details ([Code folding - Wikipedia](http://en.wikipedia.org/wiki/Folding_editor)). I loved it.
