Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

More Enhanced Editor Tips - Macros

SAS Tips

More Enhanced Editor Tips - Macros

by  klaz2002  Posted    (Edited  )
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.

klaz2002
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top