BookmarkSubscribeRSS Feed

Automating SAS using VBScript

Started ‎12-10-2015 by
Modified ‎12-10-2015 by
Views 5,182

I recently wrote a paper on automating SAS using VBScript. I wanted to share this here, as it has dozens of applications. 

 

VBScript and SAS are each powerful tools in their own right. These two technologies can be combined so that SAS code can call a VBScript program or vice versa. This gives a programmer the ability to automate SAS tasks, traverse the file system, send emails programmatically, manipulate Microsoft® Word, Excel, and PowerPoint files, get web data, and more. This paper presents example code to demonstrate each of these capabilities.

 

If you like it, please check out my other papers, downloads, and subscribe to my free bimonthly e-magazine.

 

Thanks,

Chris

chris@codeitmagazine.com

http://www.codeitmagazine.com

Comments
RW9

An interesting article, thanks for sharing.  I would point out two things however:

With VBScripting, there are a few considerations.  Firstly you can seriously damage your system/filesystem etc. if things go wrong, this is one of the main reason why X command is sometimes denied bythe IT group.  I wouldn't want to see novice users writing scripts to do things when they either don't understand it, or don't follow appropriate procedures - testing, documentation etc.  It can be quite dangerous.  Also, I have had it before where a vendor sends through a project which includes scripts calling VBAscripts and they fail, different versions or missing components etc.  Robustness should be at the forefront of development.

 

Secondly need.  With the office applications they already have VBA embedded in them.  Often we have these questions of how to update a pre-existing file with new data.  My answer is always to write VBA code to import a CSV file and process it into the spreadsheet.  This is very simple code and can be stored in the same file.  Just reduces the number of technologies needed.  Of course in an ideal world you wouldn't be using office for anything anyways, use a proper report format or data transfer format and that solves all these issues straight away.  The reliance on Excel (in particular) is one of the biggest holes in technology worldwide.

 

Version history
Last update:
‎12-10-2015 03:59 PM
Updated by:
Contributors

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Tags