If you like writing the same code over and over, then this article isn’t for you. But if you crave greater efficiency when you use SAS Studio, you’ll love Custom Task Tuesday. We are starting an article series surround custom tasks, and on Tuesdays I'll be posting an article that defines and demonstrates time-saving custom tasks in SAS Studio.
First things first.
SAS Studio Tasks are point and click interfaces used for executing SAS code. There are built-in tasks available for use, such as the Bar Chart task or the Transpose Data task. In SAS Studio, you can also build your own Custom Tasks for executing your SAS code through a point-and-click interface. Custom Tasks, written using Velocity Template Language, give you lots of options for your interface, including: checkboxes, radio buttons, drop downs (comboboxes), color selectors, dataset selectors, and many more.
Custom Tasks are an extremely easy and efficient way to run SAS code, and can be used by those who know SAS code as well as those who don’t. They are easily shared, enabling you to distribute your code more quickly than ever, and to a wider audience.
In their paper, Teach Them to Fish- How to Use Tasks in SAS Studio to Enable Coworkers to Run Your Reports Themselve..., @ChristieC_SAS and @AmyP_sas of SAS describe one great use for Custom Tasks: so others can run your code with different variables or options, without you having to re-run it for them.
Below is a screenshot of the Sample Task provided to you with SAS Studio. The Sample Task is extremely useful for getting ideas for items to incorporate into your own task, as well as viewing and copying from the Velocity Template Language code.
There are 6 possible sections in the Custom Task Model (CTM): Registration, Metadata, UI, Dependencies, Requirements, and Code Template. My following blog posts will step through each of these sections that is required for the given task.
Each article in the series will have code attached in a zip file, or you can get it from GitHub.
What would you most like to know about custom tasks?
Or do you have a tip of your own?
Ask or share it in the comments!
Thanks, this is exactly what I am looking for! My org is converting from PC SAS to SAS Studio. Most of our programs currently use %Windows and Proc Pwencode to get user names and passwords for accessing our database, so I'm trying to learn to re-create this in custom tasks. I have no experience with XML/Velocity, and keept getting errors that I can't decipher when I attempt to customize the templates, so this will be a very helpful series!
Hi @Michelle, thank you for that feedback! @OliviaWright's been working hard on the articles. Can't wait to start sharing them in here.
@Michelle, that's so great to hear! I think the Custom Tasks are a perfect solution to your problem, and the XML is easier than you think. If you have questions about specific errors, let me know!
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.