Hi all SAS Users,
Normally SAS supports a few hotkeys for us to deal with coding conveniently. For example, if we want to comment the selection with line comments, we can use 'Ctr+/"
For example:
/*Before hotkey*/
abcdef
/*After hotkey Ctr+ / */
/*abcdef*/
I also google some other useful hotket as the link here.
However, I try to find a hotket that can put words into single quotation marks. In detail
/*Before hotkey*/
abcdef
/*I try to find a hotkey to generate this result */
'abcdef'
I try to simplify my work and learn as much as I can 😄
Warmest regards.
P/S: I did a search but it seems to me that there is no hotkey so far for doing so, need a macro as the link here.
Hi @Phil_NZ,
If you're using the traditional Display Manager interface with the Enhanced Editor, it's fairly easy to create a keyboard macro for this purpose and assign a hotkey. I've just done this, following the general instructions of this 2018 post. Actually, I've created two macros:
Put current word into single quotes (i.e., place the cursor inside or immediately after the word, then hit shortcut key):
Put selected text (may include several words) into single quotes:
It really depends what editor you are using. Are you using one of the many SAS interfaces to edit with? Which one?
Hi @Tom
I am using SAS EG. It is my interface
Warm regards.
Hi @Phil_NZ,
If you're using the traditional Display Manager interface with the Enhanced Editor, it's fairly easy to create a keyboard macro for this purpose and assign a hotkey. I've just done this, following the general instructions of this 2018 post. Actually, I've created two macros:
Put current word into single quotes (i.e., place the cursor inside or immediately after the word, then hit shortcut key):
Put selected text (may include several words) into single quotes:
It is what I have now with my interface...
Sorry for the blur of the pictures but I took it by my phone.
As we can see, there is no option called "Keyboard macro".
Warmest regards.
UPDATE:
I just have a look and do some Google search, and then I figure out that it works in SAS Base while I am using SAS EG, so is there any reasonable solution for SAS EG please ?
Those macros will work in EG:
While in a program, open Program | Manage Macros and Snippets then click on Create to open a window looking like those in screenshots posted by @FreelanceReinh.
Well, this is interesting, some commands don't work at all, "insert char" is one of those.
Lol, I try to push the single quote a lot of time until it works.....seems to be a bug or the like.
Thank you for pointing this awesome point.
Even I assign and test successfully, however, I have something in my mind as below:
In my interface, it will not display totally like the Table that @FreelanceReinh shows, my interface displayed like that
First, the three single quotations are a little bit weird, why it is 3 sngle quotations?
Second, it is super hard to type a character in the "Insert character" box, do you face the same problem?
Third, It displays "Move caret..." rather than "Move curse...", easy to confuse other users.
Warm regards.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.