BookmarkSubscribeRSS Feed

Always looking for a shortcut? Custom Task Tuesday is for you!

Started ‎01-03-2017 by
Modified ‎08-04-2021 by
Views 7,256

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. 


What is the difference between SAS Enterprise Guide and SAS Studio?


What are Custom Tasks in SAS Studio?

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 Custom Task Tuesday.jpgSAS 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.


Why should I use Custom Tasks?

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.


How do I get started?

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.


Additional helpful resources:


Want to try custom tasks code for yourself?

Each article in the series will have code attached in a zip file, or you can get it from GitHub. 

Take Me to GitHub!


Questions? Tips?

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!

Version history
Last update:
‎08-04-2021 11:48 AM
Updated by:

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags