Leonid Batkhan's SAS blog

Lenetek Blog

Running SAS programs in batch on Windows

This is a summary of my recent SAS blog post on using Windows batch scripts for automating SAS processes under Microsoft's Windows Operating System. While there are many similarities between Windows scripts and Unix/Linux scripts, there are some stark differences. Let's take a look.

Automating SAS processes using Windows batch files

Running and scheduling SAS programs in Windows OS

Running SAS programs in a non-interactive fashion (batch mode) is widely used for automating SAS applications running on schedule.

Windows batch scripts are the main tools of any batch process. Understanding and having a good command of the Windows scripting language enables you to significantly expand your development abilities and agility.

Besides just running multiple OS commands sequentially one after another, batch scripts can do much more. Here is a partial list of batch scripts' functionalities:

  • Windows scripts can use environment variables which are similar to SAS macro variables
  • Windows scripts can use functions and formats
  • Windows scripts can use IF-THEN-ELSE logic to conditionally execute a command or a group of commands
  • Windows scripts can execute loops similar to the SAS' DO-loops
  • Windows scripts can receive a parameter string passed from the executed SAS program as well as pass a parameter or environment variables to the SAS program
  • Windows scripts can specify a location/folder where the SAS program saves its log
  • Windows scripts can generate a unique log file name suffixed with a datetime stamp ...

Continue reading ↪

Post a comment

Your email is never published nor shared.

Lenetek blog - homeBlog Home

 

Featured Posts

Latest Posts

Older Posts