BookmarkSubscribeRSS Feed
HAHA604
Calcite | Level 5

In Create snippet, they said If I want to be able to quickly access the snippet by entering @snippet-abbreviation in the program editor, enter an abbreviation for the snippet. I can also add a description.

So I save the coding +@ snippet-name  in my snippet, and I try to use @ or @ snippet-name and click Tabs or Enter, but they are not show me anything? Did I make some mistake in here, I want to know why and how to add @ snippet-name in my snippet.

 

thank you,

HAHA604

5 REPLIES 5
jennifert
SAS Employee

Hi @HAHA604 ,

Sorry you are having trouble!  If you want to insert snippets using "@snippet-name," you must first select the Enable snippet abbreviations option on the Editors preferences page. You can find information about this option here: 

Setting Editors Preferences 

Information about inserting snippets is here:

How to Insert a Code Snippet 

 

I hope that helps!

thanks,

Jennifer


Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF

HAHA604
Calcite | Level 5
Hi @jennifer,
thank you so much, I check my preferences page, the 'enable snippet abbreviations' was selected, but it still not let me quickly access the snippet.

kind regards,
HAHA604
jennifert
SAS Employee

Hi @HAHA604 ,

Thanks for checking your preference.  What version of SAS Studio are you running?  Here is what I did to test this:

1. I created a test snippet by writing the code in a program tab and clicking Copy to My Snippets.  When I click Copy to My Snippets, the snippet definition looks like this:

testsnippet1.gif

2. To enter the snippet in code, I typed  @testsnippet in a program tab with no space between the @ and the snippet name. When I first enter the @ in my program, a window pops up with a list of valid snippet options. I can either choose one from the list, or I can just keep typing the name and then press Enter to insert the snippet code into my program.

testsnippet2.gif

Does this process work for you?  Where are you having trouble?

 

thanks!

Jennifer


Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF

HAHA604
Calcite | Level 5

Hi @jennifer
I use the SAS University Edition, which probably is 9.4 or 3.8 base. I click "copy to my Snippet", they are not showing me like that, 1.png

only have name and position.

thank you,

HAHA604

jennifert
SAS Employee

Hi @HAHA604 ,

Yes - you are correct. The SAS University Edition uses SAS Studio 3.8.  The ability to access snippets with abbreviations was a new feature in SAS Studio 5.1.  Sorry for the confusion!

thanks,

Jennifer


Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 5 replies
  • 2296 views
  • 0 likes
  • 2 in conversation