A SAS Studio user can create his own shortcuts either for SAS content folders or for directories on the filesystem.
In this article we learn about, how an administrator can define shortcuts to SAS content folders or a directory on the filesystem for all users of SAS Studio.
The following topics are covered:
As already mentioned beside user defined shortcuts, an administrator can define global shortcuts for all users. Since this definition is on the SAS Studio level it will apply to all users of SAS Studio independent of the compute context being used.
Lets look how the SAS Studio user sees it:
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
As we can see from the image above, global shortcuts are decorated with a globe, so it is easy to distinguish them from the user defined shortcuts. These shortcut definitions (user defined or global) will be seen in the Explorer as well in the Open/Save dialog windows. They provide an easy way to folders/directories that are deeply nested.
We first look at how we can define/update global shortcut definitions.
In SAS Environment Manager:
A new window opens where we can see all the properties. We scroll down until we find the property "globalShortcuts".
In the text field we can enter/update our shortcut definitions. Each global shortcut is defined by two lines. The lines are separated by a newline control character (\n). If you enter text in the above text field the proper newline is inserted automatically.
The first line is the label of the shortcut, this is the text seen in the Explorer pane in SAS Studio. The second line is the path:
You cannot have any empty lines.
In order to see the new global shortcuts, Sign out/Sign in to SAS Studio.
The globalShortcuts property can also be set using the sas-viya configuration configurations update
command.
Follow the steps below.
We do need this later to update a JSON file.
configId=$(sas-viya --output json configuration configurations list --service SASStudio --definition-name sas.studio | jq -r '.items[] | .id')
Note the configId env var is used in the file. Please make sure that do you do not have any line breaks other than the "\n" in the text for the key globalShortcuts
tee ~/sas-studio-globalshortcuts.json > /dev/null << EOF
{
"version": 2,
"accept": "application/vnd.sas.configuration.config+json",
"name": "configurations",
"items": [
{
"id": $configId,
"metadata": {
"isDefault": false,
"mediaType": "application/vnd.sas.configuration.config.sas.studio+json;version=21",
"services": [
"SASStudio",
"studio"
]
},
"version": 1,
"globalShortcuts": "A global (sc)\nsascontent:/folders/folders/a665eb32-5e39-43a5-a1f8-6e7823272a8f\nworkshop (fs)\n/workshop"
}
]
}
EOF
How does one know what the JSON file should look like? You can use this command sas-viya configuration configurations download --service SASStudio --definition-name sas.studio
to download the complete configuration instance. Above I have only specified the minimum elements needed. You can edit the downloaded file and use it in the next step to set the new values. In this case the step to read the configuration id is not necessary.
sas-viya configuration configurations update --file ~/sas-studio-globalshortcuts.json
If everything goes according to plan, the following response is returned: "PATCH" "/configuration/configurations" complete from "/home/christine/sas-studio-globalshortcuts.json"
For debugging purposes you can add the --verbose
option to the sas-viya
command
Here are a few use cases where global shortcuts provide benefits:
You have to be a SAS administrator to define global shortcuts. These shortcuts apply to all SAS Studio users. There is currently now way to define them for instance based on group membership or for an individual compute server context. We have seen some uses cases where global shortcuts do have some benefits. The shortcuts are displayed independent of permissions for the "path". So you might get an error message if you try to access a "path" where you do not have the proper permission.
SAS Studio configuration properties make sure to select the version that matches your SAS Viya.
Excellent post ! Thanks for sharing. I wasn't aware that fs-based shortcuts might be enabled when filesystem access is switched off : it works like an AllowList access very easy to configure.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.