As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.


Here are some tips for How to share your SAS knowledge with your professional network.


Difference between revisions of "Abbreviations/Macros"

From sasCommunity
Jump to: navigation, search
(Information Sources for Creating Macro Abbreviations: update links)
 
Line 51: Line 51:
 
* [[Useful_Enhanced_Editor_macros|Quick article on the creation of Editor Abbreviations]].
 
* [[Useful_Enhanced_Editor_macros|Quick article on the creation of Editor Abbreviations]].
 
* Elizabeth Ceranowski [http://support.sas.com/resources/papers/abbreviations07.pdf SAS Abbreviations are your friends, use the template method to code!]
 
* Elizabeth Ceranowski [http://support.sas.com/resources/papers/abbreviations07.pdf SAS Abbreviations are your friends, use the template method to code!]
* Art Carpenter [http://www2.sas.com/proceedings/sugi28/108-28.pdf Creating Display Manager Abbreviations and Keyboard Macros for the Enhanced Editor]
+
* Art Carpenter, [[Creating Display Manager Abbreviations and Keyboard Macros for the Enhanced Editor]]
 
* Paul Grant [http://support.sas.com/resources/papers/proceedings09/077-2009.pdf Creating Code Templates in the SAS® Enhanced Editor using Abbreviations and User Defined Keywords]
 
* Paul Grant [http://support.sas.com/resources/papers/proceedings09/077-2009.pdf Creating Code Templates in the SAS® Enhanced Editor using Abbreviations and User Defined Keywords]
 
* SAS Usage Notes [http://support.sas.com/kb/19/335.html SAS® Enhanced Editor keyboard macros and abbreviations can be exported from SAS software and imported into SAS on another machine]
 
* SAS Usage Notes [http://support.sas.com/kb/19/335.html SAS® Enhanced Editor keyboard macros and abbreviations can be exported from SAS software and imported into SAS on another machine]
 
* Arthur Tabachneck  [[Tips:Saving some or all of your keyboard macros/abbreviations in one step]]
 
* Arthur Tabachneck  [[Tips:Saving some or all of your keyboard macros/abbreviations in one step]]
* Rick Wicklen  [http://blogs.sas.com/content/sasdummy/2011/11/17/sas-program-editor-abbrevs/ The Do Loop Blog]
+
* Rick Wicklen  [http://blogs.sas.com/content/iml/2011/11/17/define-abbreviations-in-the-sas-enhanced-editor.html Define abbreviations in the SAS enhanced editor] on The Do Loop Blog
* Chris Hemedinger [http://blogs.sas.com/content/sasdummy/2011/11/17/sas-program-editor-abbrevs/ The SAS Dummy Blog]
+
* Chris Hemedinger [http://blogs.sas.com/content/sasdummy/2011/11/17/sas-program-editor-abbrevs/ Take SAS program editor abbreviations to the next level] on The SAS Dummy Blog
 
* Christopher J. Bost, [[Edit the Editor: Creating Keyboard Macros in SAS® Enterprise Guide®]]
 
* Christopher J. Bost, [[Edit the Editor: Creating Keyboard Macros in SAS® Enterprise Guide®]]
 
* [http://support.sas.com/rnd/base/topics/abbreviations/ Base SAS: SAS Abbreviations]
 
* [http://support.sas.com/rnd/base/topics/abbreviations/ Base SAS: SAS Abbreviations]

Latest revision as of 12:35, 19 September 2017

One of the things that I've been waiting to see shipped as part of the SAS installation files is a collection of Abbreviations/Macros. I've always found abbreviations/macros to be the easiest and quickest way to include a procedure within one's code, as well as accomplish tasks and provide functionality that I thought were only available with some third-party editors.

The purpose of this page is to serve as a library of kmf files, and related code and papers, to help everyone import useful tools into their own SAS Abbreviations/Macro directory. Please add any that you have, or create, so that this page will eventually include every proc and as many useful utilities as possible.

Note that you can only have 400 macro/abbreviations on your SAS system, so choose wisely and bother whomever you can at SAS to eliminate this limitation (or at least make it more reasonable)!

Some of the macro/abbreviations follow the method described by Paul Grant in the paper referenced at the bottom of this page. In that paper, Paul explains how to set four underscores as a user defined keyword and change the Enhanced Editor's display of user defined keywords so that they appear with a Fuchsia background and black text.

Abbreviations can also be created and used in EG. See the Chris Hemedinger's blog post at the bottom of this page.

Also, how one names their macro/abbreviations can improve their utility. My own preference is to limit the names to four characters, in order to reduce keystrokes. Thus when I type impx on an Enhanced Editor screen, the macro/abbreviation for importing an xls file appears in a white box on my screen. If I then press the tab key, all of the options for using proc import with the XLS engine are automatically typed for me.

Please place any new entries, in alphabetical order, within their appropriate category.


Call Routines


Functions


Options


Procedures


Utilities
  • File:CLUP.kmf Remove blank lines from Enhanced Editor
  • File:FDATA.kmf Find datasteps in Enhanced Editor (starting with last one and searching backwards). The user who submitted this kmf actually has it named _Select Datastep.kmf on his system and has it assigned to Shift+F3. That way, he can select Shift+F3 to find a datastep, followed by F3 to run the datastep.
  • File:Header.kmf Add a consistent header to each program. Inserts the current date/time and programmer information. Edit to customize for your programming environment.


Entire Collections


Menu Modifications


Information Sources for Creating Macro Abbreviations

See also