BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Phil_NZ
Barite | Level 11

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.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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):

quoteword.png

 

Put selected text (may include several words) into single quotes:

quotesel.png

View solution in original post

8 REPLIES 8
Tom
Super User Tom
Super User

It really depends what editor you are using.  Are you using one of the many SAS interfaces to edit with?  Which one?

Phil_NZ
Barite | Level 11

Hi @Tom 

I am using SAS EG. It is my interface

My97_0-1613967821873.png

Warm regards.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
FreelanceReinh
Jade | Level 19

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):

quoteword.png

 

Put selected text (may include several words) into single quotes:

quotesel.png

Phil_NZ
Barite | Level 11

Hi @FreelanceReinh 

It is what I have now with my interface...

1.jpg2.jpg

 

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 ?

 

 

 

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
andreas_lds
Jade | Level 19

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.

andreas_lds
Jade | Level 19

Well, this is interesting, some commands don't work at all, "insert char" is one of those.

Com_EditorMacro.png

Phil_NZ
Barite | Level 11

@andreas_lds 

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 your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.
Phil_NZ
Barite | Level 11

@andreas_lds 

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

 

My97_0-1613976926807.png

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.

Thank you for your help, have a fabulous and productive day! I am a novice today, but someday when I accumulate enough knowledge, I can help others in my capacity.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 3449 views
  • 6 likes
  • 4 in conversation