We’re smarter together. Learn from this collection of community knowledge and add your expertise.

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

by SAS Super FREQ on ‎01-03-2017 10:51 AM - edited on ‎04-06-2017 06:07 PM by Community Manager (4,920 Views)

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 SAS Studio?

In this video, recorded at SAS Global Forum 2015, you'll learn how to submit your SAS code via SAS Studio, a web option for 

accessing SAS.


Interviewed by SAS Support Communities Manager Chris Hemedinger, SAS Software Development Manager Christie Corcoran describes how it complements SAS Enterprise Guide and reveals how analytics subject-matter experts across SAS, including SAS CEO Jim Goodnight, played a role in its development.



What are Custom Tasks?

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!


by Contributor Michelle
on ‎01-05-2017 11:07 AM

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! 

by Community Manager
on ‎01-05-2017 12:24 PM

Hi @Michelle, thank you for that feedback! @OliviaWright's been working hard on the articles. Can't wait to start sharing them in here.

by SAS Super FREQ
on ‎01-06-2017 09:28 AM

@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!

Your turn
Sign In!

Want to write an article? Sign in with your profile.

Looking for the Ask the Expert series? Find it in its new home: communities.sas.com/askexpert.