I'd like the Enhanced Editor of the next version of PC SAS to have a function to convert the spaces within a highlighted section of code to underscores.
It would take:
my new variable
and covert it to:
I'd suggest Ctrl + Shift + - as the shortcut. This is something that I would use numerous times per day.
thanks for the posted workarounds!
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.
What @ballardw is saying is true of EG; see Program >> Editor Macros or Enhanced Editor Keys.
@ballardwGot it! Thanks! Wow, an enhancement without a release!
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?
Select the phrase to be converted to variable.
Tools | Keyboard Macros | Record New Macro
Find Text = ‘ ‘
Replace with = ‘_’
Click Replace in Selection button
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 + -
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.
yes... Much easier to record it than construct it from the list of actions, which is what I was doing, thanks...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.