An Idea Exchange for SAS software and services

by Super User
on ‎11-08-2016 05:07 PM

I don't use EG but the Base SAS editor allows the creation of editor macros that would do this. You can also assign the short cut key combination of preference. From the Enhanced editor see if the Tools menu has a Keyboard Macros choice. If so it likely has record new macro that you would then do the search and replace. 

by Regular Contributor
on ‎11-08-2016 05:09 PM

What @ballardw is saying is true of EG; see Program >> Editor Macros or Enhanced Editor Keys.

by New Contributor RayGivler1
‎11-10-2016 07:41 PM - edited ‎11-11-2016 09:24 AM

@ballardwGot it! Thanks! Wow, an enhancement without a release!

by Regular Contributor
on ‎11-23-2016 11:00 AM

Ray?  Did you get your macro to work?  Its a great idea.  There's something about this Editor Macro business I don't quite get.  If you were sucessful could you share your instructions?

by New Contributor RayGivler1
on ‎12-02-2016 08:14 AM


Select the phrase to be converted to variable.

Tools | Keyboard Macros | Record New Macro


Find Text = ‘ ‘

Replace with = ‘_’

Click Replace in Selection button

Click Close

Tools | Keyboard Macros | Stop Recording

   In “Save Keyboard Macro” form, enter a macro name and description, and click Assign Key.

In the “Assign Key” form:

      Click in the Press new shortcut key field, and click your key choice. I used Shift + Ctlr + -

      Click Assign

      Click OK

I may have missed a step on the assignment, you can go back in and assign via Tools | Keyboard Macros | Macros and the Assign keys button.


You may want to add another step in the macro recording to replace ‘-‘ with ‘_’ as well.

by Regular Contributor
on ‎12-06-2016 10:58 AM

yes...   Much easier to record it than construct it from the list of actions, which is what I was doing, thanks... 

by SAS Employee Casey_SAS
on ‎04-14-2017 11:20 AM
Status changed to: Not Planned

thanks for the posted workarounds!

Idea Statuses
Top Liked Authors