The sas-admin command-line interface ships with Viya software. But you don't need to create whole new Viya deployment to get updates. The latest version is available for download from support.sas.com. In this post I will review how to check what updates are available, and install and update the downloadable version of the command-line interface.
You can download the command-line interface(CLI) from support.sas.com. There are versions for Linux, Mac, and Windows. I keep the Windows version on my laptop so that I can connect to various SAS Viya environments and perform administrative tasks. When there are updates, I download a new version and unzip it to a directory on my laptop.
Getting an updated executable is just the first step. The sas-admin executable is the wrapper; the main functionality of the CLI is surfaced via plug-ins. You can use the CLI to check on the status of your local plug-ins, add new plug-ins, and update existing plug-ins. Plug-ins are installed from a repository. To see what repository you are configured to use, run the command.
sas-admin.exe plugins list-repos
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
This is the default SAS hosted repository. If you navigate to the url http://support.sas.com/repos/admincli/, you can see information on the plug-ins available in the repository.
You can check the status of your locally installed plug-ins using the following command.
sas-admin plugins list-repo-plugins
The command outputs all the plug-ins available in the repository and also compares them to the plugins installed locally. In the output of the command plug-ins are flagged with an indicator that reflects their status:
In my environment the output shows:
To install a new plug-in, for example fonts, use the install command:
sas-admin plugins install --repo SAS fonts
It is the same command to update a plugin, but the output is a little different as it provides information about the versions it is upgrading from and the new version.
sas-admin plugins install --repo SAS authorization
The output indicates that the authorization plug-in was updated from version 1.2.1o to 1.2.18
The plug-ins are installed, by default, in the .sas sub-directory of the users home directory.
You can only install one plug-in at a time but some simple shell scripting allows you to install or update all plug-ins from a particular repository. Change directory to the directory where you installed the sas-admin executable and then run the code.
On LINUX
cd /opt/admincli082018
for p in $($PWD/sas-admin plugins list-repo-plugins | awk 'NR > 3 { print $1 }' )
do
$PWD/sas-admin plugins install --repo SAS ${p#"*"}
done
On WINDOWS (thank you Gilles Chrzaszcz for the Windows scripting)
cd c:\admincli082019
for /F "skip=3 delims= " %i in ('%cd%\sas-admin.exe plugins list-repo-plugins') do (for /f "tokens=1* delims=^*" %j in ('echo %i') do %cd%\sas-admin.exe plugins install -repo SAS %j))
The plug-ins are backward and forward compatible, and can be updated more often than Viya releases. It can be very useful to grab the latest version. To see how to use the CLI checkout my previous article.
For me, the impetus to upgrade was new functionality in the folders plug-in which can now list the root level Viya folders.
sas-admin --output text folders list-members --path /
The SAS Administration CLI is a great feature of the Viya software and new functionality is being added all the time. I hope you found this post useful. For more information on using the CLI, check out the following:
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.