Edit the Editor: Creating Keyboard Macros in SAS Enterprise Guide

Similar documents
Uncommon Techniques for Common Variables

A Guided Tour Through the SAS Windowing Environment Casey Cantrell, Clarion Consulting, Los Angeles, CA

Microsoft Office Outlook 2007: Intermediate Course 01 Customizing Outlook

TIPS FROM THE TRENCHES

CDS 32 Version 2.xx File Utilities

Welcome In this chapter

Question: How do I move my mobile account from the Corporate to my Personal Account?

Overview. CHAPTER 2 Using the SAS System and SAS/ ASSIST Software

Tutorial 3D Max (for beginners) PART I

Guide to User Interface 4.3

ABSTRACT MORE THAN SYNTAX ORGANIZE YOUR WORK THE SAS ENTERPRISE GUIDE PROJECT. Paper 50-30

CNC Transfer. Operating Manual

Application software CA700 Application

2 Working with a Database

Using the Customize Dialog Box

2 Frequently Asked... Questions. 4 How Do I... 1 Working within... Entries

SpyLite User s Guide for BTW

Included with the system is a high quality speech synthesizer, which is installed automatically during the SymWord setup procedure.

Using the Dev C++ Compiler to Create a Program

I KNOW HOW TO PROGRAM IN SAS HOW DO I NAVIGATE SAS ENTERPRISE GUIDE?

APPENDIX 4 Migrating from QMF to SAS/ ASSIST Software. Each of these steps can be executed independently.

Make SAS Enterprise Guide Your Own. John Ladds Statistics Canada Paper

GX-M2. FREE 3 YEAR WARRANTY REGISTRATION MODEL NUMBER: ENGXM20100BKEW

How to Import a Certificate When Using Microsoft Windows OS

DataMaster for Windows

IHS Enerdeq Desktop International Training Guide

PC and Windows Installation 32 and 64 bit Operating Systems

SQL Metadata Applications: I Hate Typing

For ClassPad 300 PLUS. ClassPad Manager. Version 2.2 (PROGRAM-LINK TM ) User s Guide.

download instant at

SIMDELL USER MANUAL Rent Arrears

BIMCO's IDEA - User Manual

2. This will bring you to a new window asking what type of policy you are inserting. Personal Policies. Commercial Policies. All Other Policies

Fairfield University Using Xythos for File Storage

English. TI.GRAPH LINKé. FOR WINDOWSë FOR THE TI.89 CONDENSED GUIDEBOOK. Texas Instruments Instructional Communications. Guidebook developed by:

ZENworks 2017 Update 2 Endpoint Security Utilities Reference. February 2018

Switch between open apps Close the active item, or exit the active app

ZENworks 11 Support Pack 4 Endpoint Security Utilities Reference. October 2016

IBM NetBAY Virtual Console Software. Installer and User Guide

SuperNova. Magnifier & Speech. Version 15.0

AGent VERSO. Version 5.1 Product Information Bulletin. Printing Spine and Pocket Labels

DAMION DISCOVERY REFERENCE GUIDE

Technical specifications

BIMCO's idea 2 - User Manual

INSTALLATION GUIDE activepdf DOCCONVERTER. Document Number: APDC_IG_41

Lab 3.1 : The Task Manager

HealthStream Connect Administrator User Guide

A Practical Introduction to SAS Data Integration Studio

Outlook Tips & Tricks

Multi-Find/Change 3.0 Manual

User Guide 701P Wide Format Solution Wide Format Scan Service

Importing the Source Models. Placing a 3D Model in the Workspace. Modified by on 25-Jul-2014

FM 4/100 USB Software for OSX

Installation, Upgrade, and Setup Guide Version: 10.2

Journey to the center of the earth Deep understanding of SAS language processing mechanism Di Chen, SAS Beijing R&D, Beijing, China

SAS Model Manager 15.1: Quick Start Tutorial

Gradebook User Guide. PowerTeacher

APPENDIX 2 Customizing SAS/ASSIST Software

University of Mary Washington. FOC Planning Tool User s Guide Kwadwo Brobbey, Kelly Brown, Rebecca Wright

Learning Guide for User Interface 4.3

Information Visualization

Dynamic Projects in SAS Enterprise Guide How to Create and Use Parameters

1 Ctrl + X Cut the selected item. 2 Ctrl + C (or Ctrl + Insert) Copy the selected item. 3 Ctrl + V (or Shift + Insert) Paste the selected item

Projector Warping Tool Ver.1.20 User s Manual

Sage 100 ERP. Getting Started Guide. This version of the software has been retired

Paper HOW-06. Tricia Aanderud, And Data Inc, Raleigh, NC

239 Excel Keyboard Shortcuts

DISCLAIMER Whilst every effort has been made

Migrating ABECAS Insight

DataSpy. For Microsoft Dynamics. Microsoft Dynamics GP Professional Microsoft Dynamics GP Standard Microsoft Small Business Financials

Maintenance Menu User Guide

DATA Step Debugger APPENDIX 3

Stat-VU Version 3.2 User s Guide

Process Document Financials 9.0: Creating a PO from Copying a PO. Version 9.0 Document Generation Date 2/16/2009 Last Changed by Status

Horizon Launcher Configuration Guide

Chapter 3 Managing Results in Projects. Chapter Table of Contents

Chapter 2 Entering Data. Chapter Table of Contents

QuickBooks 2006 Data File Scanning Utility

Working with Mailbox Manager

ASSEMBLER USER GUIDE. Developed and published by Expedience Software Copyright Expedience Software

Chapter 1: Getting Started

Exporting Files from Succeed for use in Canvas Modules

BI-09 Using Enterprise Guide Effectively Tom Miron, Systems Seminar Consultants, Madison, WI

Network Player Management Software

SAP NAVIGATION QUICK REFERENCE CARD

New York State Department of Health Medicaid Perinatal Care Quality Improvement Project

Chapter 5 Making Life Easier with Templates and Styles

Copyright ATRIL Language Engineering, SL. All rights reserved.

SAS Studio: A New Way to Program in SAS

Introduction to the File Manager

An Introduction to SAS/FSP Software Terry Fain, RAND, Santa Monica, California Cyndie Gareleck, RAND, Santa Monica, California

Submitting Code in the Background Using SAS Studio

KYOCERA Net Viewer 5.3 User Guide

Microsoft Word - Templates

Installing Dynamicweb Wrap Community Edition

EMC Documentum My Documentum Desktop (Windows)

Objectives Learn how free online map data can quickly and easily be used to dynamically update background maps and aerial photography in GMS.

Intellisync Lite. Page ii

Accountants. Enterprise. Installation Guide. Administration Centre. Version 3.0

HLC Annotations Management

Transcription:

Paper 3502-2015 Edit the Editor: Creating Keyboard Macros in SAS Enterprise Guide Christopher J. Bost, MDRC, New York, NY ABSTRACT Programmers can create keyboard macros to perform common editing tasks in SAS Enterprise Guide. This paper introduces how to record keystrokes, save a keyboard macro, edit the commands, and assign a shortcut key. Sample keyboard macros are included. Techniques to share keyboard macros are also covered. INTRODUCTION All programmers repeat actions when editing SAS programs. For example, inserting a comment and your initials, or selecting and running the current DATA step. This is a manual process that requires the same amount of time and effort in each instance. SAS Enterprise Guide can record keystrokes and save them in a keyboard macro. It can be edited as needed and assigned a shortcut key. Keyboard macros can be exported to a file and then imported by others, helping them save time and effort. This paper illustrates how to create a simple keyboard macro that encloses everything from the cursor to the end of the line in a /*comment*/. Three steps are reviewed: 1) recording keystrokes; 2) editing keyboard macros; and 3) assigning shortcut keys. Methods for sharing keyboard macros are detailed. Additional keyboard macros are included in the appendix. 1. RECORDING KEYSTROKES Keyboard macros can be created from scratch with Program > Editor Macros > Macros > Create It is usually helpful, however, to record keystrokes. Start recording keystrokes with Program > Editor Macros > Record New (or press Ctrl+Shift+R). The cursor bar now includes what appears to be a cassette tape (i.e., and indicates recording): Perform any action(s). In our example, we comment the rest of the line: 1. Enter /* to start the comment. 2. Press End to move to the end of the line. 3. Enter */ to end the comment. Stop recording with Program > Editor Macros > Stop Recording (or press Ctrl+Shift+R again). SAS Enterprise Guide opens the Save Keyboard Macro dialog box: Figure 1. Save Keyboard Macro Dialog Box 1

Enter values in the Keyboard macro name and Keyboard macro description text boxes. For example: Figure 2. Save Keyboard Macro Dialog Box Values Click the OK button to save the keyboard macro. Note that a shortcut key could be added with the Assign keys button, but we will edit the keyboard macro first to inspect it and make any needed changes. 2. EDITING KEYBOARD MACROS Edit a keyboard macro with Program > Editor Macros > Macros. SAS Enterprise Guide opens the Keyboard Macros dialog box: Figure 3. Keyboard Macros Dialog Box Click on a macro name and then click the Edit button. SAS Enterprise Guide opens the Edit Keyboard Macro dialog box (see Figure 4 below). It displays the Keyboard macro name and Keyboard macro description you previously entered. All of the keyboard macro commands built into SAS Enterprise Guide are displayed in the Commands box on the left. Click on the Command category drop-down menu to select a category. Click on any individual command to display details in the Command description box. 2

The recorded actions are displayed in the Keyboard macro contents box on the right: Figure 4. Edit Keyboard Macro Dialog Box Note that five commands were recorded: 1. Two Insert character commands to insert the slash and asterisk, respectively. 2. A navigation command, Move caret to end of line, to indicate pressing End. 3. Two more Insert character commands to insert the closing asterisk and slash. The keyboard macro contents look correct. Click the Cancel button to exit the dialog box. If editing were required, commands can be inserted, modified, deleted, and/or moved. Highlight a command in the Commands box and click to insert it. It will be inserted after all other commands in the Keyboard macro contents box by default or above any command that is highlighted. Commands in the Keyboard macro contents box can be modified, deleted, and/or moved. Click on any command(s) to select them and then click any of the following buttons to perform the respective action: modify the selected command delete the selected command(s) move the selected command(s) up one line move the selected command(s) down one line Click the OK button when editing is complete. 3

3. ASSIGNING SHORTCUT KEYS Assign a shortcut with Program > Editor Macros > Macros > [click on a macro name] > Assign keys SAS Enterprise Guide opens the Assign Keys dialog box: Figure 5. Assign Keys Dialog Box User-defined keyboard macros are displayed by default in the Commands box. Assign a shortcut key as follows: 1. Click on a keyboard macro name. 2. Click in the Press new shortcut key box. 3. Press the desired key combination. For example, Alt+C. SAS Enterprise Guide notes if that shortcut key is currently assigned to another command. Choose a unique and, if possible, intuitive shortcut. 4. Click the Assign button. 5. Click the OK button. The keyboard macro shortcut key is now available for use. Consider the following example: Note that the cursor is positioned immediately after sashelp.class. To end the statement and comment the rest of the line, type a semicolon and press the Alt+C shortcut key. The code now looks as follows: 4

SHARING KEYBOARD MACROS Export keyboard macros to a file and then import them in SAS Enterprise Guide on another computer. EXPORTING KEYBOARD MACROS Display the keyboard macros available with Program > Editor Macros > Macros. SAS Enterprise Guide opens the Keyboard Macros dialog box. Select a keyboard macro to export by clicking its name. Select multiple keyboard macros by clicking on one name and then Shift+Click on another name. Use Ctrl+Click to select (or unselect) an individual keyboard macro: Figure 6. Keyboard Macros Dialog Box Click the Export button. SAS Enterprise Guide opens the Export Keyboard Macros dialog box: Figure 7. Export Keyboard Macros Dialog Box 5

Navigate to a folder to save a Keyboard Macro File (*.kmf) that stores keyboard macro(s). In Figure 7, a folder named Keyboard macros was created. When exporting multiple macros, you can replace the file name with any name (e.g., mymacros). Click the Save button. The keyboard macro(s) have been exported to the.kmf file. The.KMF file can be saved to a location available to other users (e.g., shared network drive). It can also be copied, e-mailed, or otherwise distributed. IMPORTING KEYBOARD MACROS Open SAS Enterprise Guide on the computer where you want to use the shared keyboard macros with Program > Editor Macros > Macros. SAS Enterprise Guide opens the Keyboard Macros dialog box. Click the Import button. SAS opens the Import Keyboard Macros dialog box: Figure 8. Import Keyboard Macros Dialog Box Navigate to the location, click on the exported.kmf file, and then click the Open button. The keyboard macro(s) are added. Click the Close button. If you attempt to import a keyboard macro that has the same name as an existing keyboard macro, SAS Enterprise Guide prompts: A keyboard macro with the name name already exists. Replace the existing keyboard macro? for each occurrence. Click the Yes button to import the keyboard macro and overwrite the existing keyboard macro. Click the No button to not import the keyboard macro. If you wish to import a keyboard macro without overwriting an existing keyboard macro that has the same name, the existing one can be renamed. In the Keyboard Macros dialog box, click on the keyboard macro name, click the Edit button, change the Keyboard macro name, and click the OK button. Assign shortcuts to the imported keyboard macros as described in Section 3: Assigning Shortcut Keys. CONCLUSION Take note of actions you perform repeatedly when editing programs. Consider recording keystrokes, saving keyboard macros, and assigning shortcut keys. Using the shortcuts will save time and effort. Share keyboard macros with others. This paper demonstrated how to create a simple keyboard macro. See the appendix for details on additional keyboard macros. 6

CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the author at: Christopher J. Bost MDRC 16 East 34 th Street New York, NY 10016 (212) 340-8613 christopher.bost@mdrc.org chrisbost@gmail.com SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. Other brand and product names are trademarks of their respective companies. APPENDIX Sample keyboard macros are included in the file CBkeys.kmf in the.zip file that accompanies this paper. Unzip the file and save to disk. Follow the instructions on importing keyboard macros detailed on page 6. The following keyboard macros are included: Name Shortcut Description Usage Notes AddDateInit Alt+I Add date and initials Edit the line Insert the string XYZ-- at the current position. to include your initials. Inserts the text: mm/dd/yy--xyz-- AddLine F5 Add line after current Adds line after the current line regardless of the cursor position. Equivalent to pressing End and Enter. CommentEOL Alt+C Comment to EOL Inserts a /* comment */ around all following text on that line. Do not nest this type of comment. MoveLineDn Alt+D Move line down Moves current line down one line. Press repeatedly to keep moving. MoveLineUp Alt+U Move line up Moves current line up one line. Press repeatedly to keep moving. SelectStep F7 Select current step Selects DATA step or PROC step where cursor is positioned. Step must start with DATA or PROC/end with RUN; or QUIT; Table A1. Sample Keyboard Macros The Shortcut keys are optional but suggested. None of them is preassigned by SAS Enterprise Guide. These keyboard macros were developed under SAS Enterprise Guide 5.1 for illustrative purposes. They are not guaranteed to work in every situation. They may be shared and/or modified at your discretion. Be sure to review the built-in commands with Program > Enhanced Editor Keys Click the Category drop-down menu and select All. Check the box next to Include commands without key assignments. There are numerous useful commands available; do not reinvent the wheel. Click the Assign keys button to assign your preferred shortcut key. 7