In my previous post, SAS Studio Custom Steps: Reduce, Reuse & Recycle Part I, we discussed how you can reduce setup and configuration time when creating custom steps by reusing the controls in the Sample Controls custom step. Following on from that post, we will now discuss how to recycle custom steps using the SAS Studio Custom Step Repository.
Reuse & Recycle
SAS Studio custom steps are a great way to promote code reusability. Once developed, they can be used by other SAS Studio users.
This video reviews the SAS Studio custom step repository in GitHub where you and other SAS users can publish, share and download custom steps. We will download a single step, upload it into SAS Studio and use it as a standalone step.
Want to try it for yourself? Here are the instructions.
View and Investigate the SAS Custom Step Repository
- To view the SAS custom step repository, go to github.com/sassoftware/sas-studio-custom-steps.
Select any image to see a larger version.
Mobile users: To view the images, select the "Full" version at the bottom of the page.
- The repository contains several custom steps, including steps representing advanced data transformations. We recommend checking the built-in SAS Studio steps and the SAS Studio custom steps repository before creating your own custom step, just in case a step already exists that’s the same or similar to your requirements.
- Scroll down to the Getting Started section. Click the link labelled Using a Custom Step from the GitHub repository in SAS Studio for the most up-to-date instructions on downloading custom steps from this repository and making them available for use in your SAS Studio environment.
You can download the complete repository or a single file step.
- Click the link labelled sas-studio-custom-steps, in the breadcrumbs at the top of the page, to return to the home page.
- You are encouraged to participate and contribute to the repository. Scroll down and click the link labelled CONTRIBUTING.md to review how you can contribute your own custom steps!
Downloading a Single Step
- If necessary, click the link labelled sas-studio-custom-steps to return to the home page in the GitHub repository.
- Click Lookup to open the folder containing the Lookup step and instructions.

- The Lookup custom step will add a column to a table by performing a lookup on another table using hash objects. Please be aware that custom steps in the repository are hosted by SAS but contributed to by the global SAS community. This means that they are not guaranteed to be backwards compatible, so it’s advisable to view any requirements, version dates, or both. The Lookup step does not have any requirements.
- Click the Lookup.step link.

- Click
to download the step to the Downloads folder.
Uploading a Single Step
Now we can upload the custom step in SAS Studio.
- Log into SAS Studio on SAS Viya.
- If necessary, click
in the navigation pane, on the left.
- To make SAS custom steps available in the Shared tab of the Steps section in the navigation pane, we need to save it in SAS Content. Expand SAS Content.
- To make it available to other users, it needs to be saved in a folder that has the restrictions/permission you require. I only have My Folder available to me in my SAS Viya environment which means that, when the custom step is saved, myself and administrators will see it in the Shared tab of the Steps section in the navigation pane but no one else will. Expand Folder Shortcuts and Shortcut to My Folder.
- Select
to upload the file.

- Click Add and navigate to the Downloads.
- Select Lookup.step and click Open.
- Click Upload to upload the custom step to your folder.
Using a Custom Step in the SAS Studio Workspace
Now I can use the custom step in a tab in the SAS Studio workspace, often referred to as standalone. Of course, you can also use this step in a flow if that suits your requirements. We will use the GEOEXM data table from the SASHELP library. This data table contains street addresses from North Carolina. We will use the ZIP Code as the lookup key to return the variable that contains the County name from the ZIPCODE data table, also from the SASHELP library.
- Click
in the navigation pane to access the Steps section.
- Select the Shared tab and right-click Lookup and select Open in a tab.
- Click
at the end of the prompt labelled Base table. Click SASHELP, select GEOEXM, and click OK.
- On the prompt labelled Columns to keep, click
. Select Name, City, and ZIP and click OK.
- Click
at the end of the prompt labelled Lookup table. Click SASHELP, select ZIPCODE, and click OK.
- On the prompt labelled Lookup Key Column(s), click
and select ZIP and then OK.
- Click
on the prompt labelled Return Column and select COUNTYNM and click OK.
- Leave the prompt labelled Value to use when lookup does not return values.
- At the end of the prompt labelled Result Table, click
. Click WORK, enter NC, for North Carolina, in the Table field, and click OK.
- Click Submit Custom Step to run the custom step.

The output data table named NC appears to the right of the custom step and contains 21259 rows and 4 columns. The last column, named COUNTYNM, contains the column returned from the lookup.

Summary
There are so many valuable assets available regarding SAS Custom Steps for SAS Studio! During this post we downloaded one step, take a look here for advice on uploading all steps from the SAS Studio Custom Step Repository.
To summarize:
- For custom steps to be available in the Shared tab of the Steps section in the navigation pane they must be saved in SAS Content. To make them available to other store custom steps in a folder with the necessary permissions.
- Before embarking on creating custom steps, check the SAS provided steps and the SAS Studio Custom Step Repository in case a similar step to your requirements already exists.
- Share your finished custom step with other SAS Studio users by adding it to the SAS Studio Custom Step Repository.
- Learn more about SAS Custom Steps by attending the Developing Custom Steps using SAS Studio Analyst course.
Useful Links:
Find more articles from SAS Global Enablement and Learning here.