Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

SAS Tips

More Enhanced Editor Tips - Macros by klaz2002
Posted: 23 Sep 03

Most of us think of editor macros (not SAS macros) as too complicated to bother. But, I have found that with a short learning curve they can be extremally rewarding.
I'll give an example to illustrate my point.  My company has many SOP's (standard operating procedure) in the way the SAS programs must conform.  One 'rule/suggestion' is that the code should be at least 3 spaces from the margin.  This can be very annoying when your pressed to 'pump-out' a program. (to remember to hit the spacebar 3 times and more when you indent) (yes I love to complain)
I have found that with a few short tweaks you can have the SAS enhanced editor do that task for you.  All you have to do (after the set-up) is highlight the part of code that you want indented/moved (X spaces).  Voila!! its done and conforms to the standards that you workplace uses.

Here is how to do the set-up.
1) Open the SAS Enhanced editor and choose the options selection from the TOOLS menu.
2) Select the Enhanced Editor from the exapnded menu and choose the General tab (this is the default).
3) Check the box that says 'Insert spaces for tabs'.
4) Adjust the amount of spaces for the tab key (this is located to the left of the last selection)and hit the OK button.

5)Under the TOOLS menu select the keyboard macros->Macros.  This will launch the keyboard macros box.
6) Select 'Create' from the right side of the box. Choose the 'Indent Selection' macro by selecting it and clicking the add-to-box button. Name the new macro and click the OK button.
7) Now you may assign keys to this macro.  Click the "Assign Keys" button. You may assign any key or key sequence to kick off this macro.  The SAS editor will tell you if that key sequence is used by the system.  Normally you would use a ctl+another key. (EX. ctl+R) After you choose the key sequence click the OK button and your done.  

Try your new powers with the SAS Enhanced editor. All you have to do is highlight the text that you want indented.


Back to SAS Institute, Inc. solutions FAQ Index
Back to SAS Institute, Inc. solutions Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close