At the time of writing the SAS Studio Custom Steps repository contains 57 Custom Steps. Their functionality ranging from importing data, to doing data quality, over synthetic data generation to NLP functionality - quite the impressive spectrum don't you think?
So with that the question arises how to get them into your SAS Viya environment. You could of course dig through every single folder, grab the .step file and upload it by hand...
So how can we improve this process? We will take a look at three approaches with differing levels of automation:
This first approach makes use of a SAS script that uses the SAS Git functions, macros by the one and only SAS Jedi and SAS Viya APIs. You will have to specify a target folder in which you have already cloned the Custom Steps repository or in which you want it to be cloned and you need to specify a folder in SAS Content that should contain all of the Custom Steps.
* Enter the folder in which the SAS Studio Custom Steps are available;
%let targetFolderServer = /shared-data/SAS-Studio-Custom-Steps;
* If set to one the repository will be cloned into targetFolderServer path;
* Set the value to 0 if you already have the repository cloned;
%let wantCloning = 1;
* If you have the repository already cloned set this to 1 to pull new changes;
%let wantPull = 0;
* Enter the folder where the SAS Studio Custom Steps should be stored in SAS Content;
%let targetFolderContent = /Public/Custom Steps;
* Replace previously already existing steps - set to true if you want to replace steps;
* Setting this to true is recommend if you pull the repository to get updated steps;
%let replaceSteps = false;
If you set the macro variable wantCloning to 1, the script will automatically clone the official SAS Studio Custom Step repository from GitHub.
Please note that activating the replaceSteps option can lead to breaking changes and require updates to SAS Studio flows that use updated Custom Steps. This is because Custom Step authors might introduce new required options or other breaking changes.
As you can see, you can also configure this to pull in changes and additions that happen overtime. You can get the full SAS code over at my SAS Snippets GitHub repository - here is a GIF showing this script in action - here I specify a folder into which I have cloned the repository using the Git pane in SAS Studio:
This approach was shared with me by @Wilbram-SAS , don't get me wrong I'm not calling him lazy - far from it! The process is simple:
Here is a GIF demonstrating the process:
This approach assumes that you have cloned the GitHub repository to your local machine (assuming Windows here) or have downloaded and unzipped it to a folder. We will run a PowerShell command to copy all .step files from the repository folder to one folder so you can quickly drag and drop them into SAS Content.
# Navigate to the path
cd "C:\Users\<username>\Documents\SAS_Repos\sas-studio-custom-steps"
# Create the folder will hold all steps
mkdir ..\All-Steps
# Copy all steps to the new folder
Get-ChildItem -Path ".\*" -Include *.step -Recurse | Copy-Item -Destination "..\All-Steps"
Now you can just select the steps that are of interest to you and upload them to SAS Content:
Now you have no excuse not to make use of the awesome utility of all of the Custom Steps available on GitHub - enjoy and let me know which method you end up choosing. I know I'm using the fully automated way of doing things!
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.