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
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:
Information about inserting snippets is here:
I hope that helps!
thanks,
Jennifer
Catch the SAS Global Forum keynotes, announcements, and tech content!
sasglobalforum.com | #SASGF
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:
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.
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
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,
only have name and position.
thank you,
HAHA604
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
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.