Applications Development Papers A-Z

A
Paper 1980-2015:
A Practical Guide to SAS® Extended Attributes
All SAS® data sets and variables have standard attributes. These include items such as creation date, engine, compression and sort information for data sets, and format and length information for variables. However, for the first time in SAS 9.4, the developer can add their own customized attributes to both data sets and variables. This paper shows how these extended attributes can be created, modified, and maintained. It suggests the sort of items that might be candidates for use as extended attributes and explains in what circumstances they can be used. It also provides a worked example of how they can be used to inform and aid the SAS programmer in creating SAS applications.
Read the paper (PDF).
Chris Brooks, Melrose Analytics Ltd
Paper 3465-2015:
A Quick View of SAS® Views®
Looking for a handy technique to have in your toolkit? Consider SAS® Views®, especially if you work with large data sets. After a brief introduction to SAS Views, I'll show you several cool ways to use them that will streamline your code and save workspace.
Read the paper (PDF).
Elizabeth Axelrod, Abt Associates Inc.
Paper 3194-2015:
A Tool That Uses the SAS® PRX Functions to Fix Delimited Text Files
Delimited text files are often plagued by appended and/or truncated records. Writing customized SAS® code to import such a text file and break out into fields can be challenging. If only there was a way to fix the file before importing it. Enter the file_fixing_tool, a SAS® Enterprise Guide® project that uses the SAS PRX functions to import, fix, and export a delimited text file. This fixed file can then be easily imported and broken out into fields.
Read the paper (PDF). | Download the data file (ZIP).
Paul Genovesi, Henry Jackson Foundation for the Advancement of Military Medicine, Inc.
Paper 2123-2015:
Anatomy of a Merge Gone Wrong
The merge is one of the SAS® programmer's most commonly used tools. However, it can be fraught with pitfalls to the unwary user. In this paper, we look under the hood of the DATA step and examine how the program data vector works. We see what's really happening when data sets are merged and how to avoid subtle problems.
Read the paper (PDF).
Joshua Horstman, Nested Loop Consulting
Paper 2220-2015:
Are You a Control Freak? Control Your SAS® Programs - Don't Let Them Control You!
You know that you want to control the process flow of your program. When your program is executed multiple times, with slight variations, you will need to control the changes from iteration to iteration, the timing of the execution, and the maintenance of output and logs. Unfortunately, in order to achieve the control that you know that you need to have, you will need to make frequent, possibly time-consuming and potentially error-prone, manual corrections and edits to your program. Fortunately, the control you seek is available and it does not require the use of time-intensive manual techniques. List processing techniques are available that give you control and peace of mind and enable you to be a successful control freak. These techniques are not new, but there is often hesitancy on the part of some programmers to take full advantage of them. This paper reviews these techniques and demonstrates them through a series of examples.
Read the paper (PDF).
Mary Rosenbloom, Edwards Lifesciences, LLC
Art Carpenter, California Occidental Consultants
B
Paper 3466-2015:
Bare-bones SAS® Hash Objects
We have to pull data from several data files in creating our working databases. The simplest use of SAS® hash objects greatly reduces the time required to draw data from many sources when compared to the use of multiple proc sorts and merges.
Read the paper (PDF). | Download the data file (ZIP).
Andrew Dagis, City of Hope
Paper 3162-2015:
Best Practices: Subset without Getting Upset
You've worked for weeks or even months to produce an analysis suite for a project. Then, at the last moment, someone wants a subgroup analysis, and they inform you that they need it yesterday. This should be easy to do, right? So often, the programs that we write fall apart when we use them on subsets of the original data. This paper takes a look at some of the best practice techniques that can be built into a program at the beginning, so that users can subset on the fly without losing categories or creating errors in statistical tests. We review techniques for creating tables and corresponding titles with BY-group processing so that minimal code needs to be modified when more groups are created. And we provide a link to sample code and sample data that can be used to get started with this process.
Read the paper (PDF).
Mary Rosenbloom, Edwards Lifesciences, LLC
Kirk Paul Lafler, Software Intelligence Corporation
C
Paper 3224-2015:
CHARACTER DATA: Acquisition, Manipulation, and Analysis
The DATA step enables you to read, write, and manipulate many types of data. As data evolves to a more free-form state, the ability of SAS® to handle character data becomes increasingly important. This presentation, expanded and enhanced from an earlier version, addresses character data from multiple vantage points. For example, what is the default length of a character string, and why does it appear to change under different circumstances? Special emphasis is given to the myriad functions that can facilitate the processing and manipulation of character data. This paper is targeted at a beginning to intermediate audience.
Read the paper (PDF).
Andrew Kuligowski, HSN
Swati Agarwal, OptumInsight
Paper 3210-2015:
"Can You Read This into SAS® for Me?" Using INFILE and INPUT to Load Data into SAS
With all the talk of 'big data' and 'visual analytics' we sometimes forget how important it is, and often how hard it is, to get external data into SAS®. In this paper, we review some common data sources such as delimited sources (for example, CSV), as well as structured flat files, and the programming steps needed to successfully load these files into SAS. In addition to examining the INFILE and INPUT statements, we look at some methods for dealing with bad data. This paper assumes only basic SAS skills, although the topic can be of interest to anyone who needs to read external files.
Read the paper (PDF).
Peter Eberhardt, Fernwood Consulting Group Inc.
Audrey Yeo, Athlene
Paper 3367-2015:
Colon(:)izing My Programs
There is a plethora of uses of the colon (:) in SAS® programming. The colon is used as a data or variable name wild-card, a macro variable creator, an operator modifier, and so forth. The colon helps you write clear, concise, and compact code. The main objective of this paper is to encourage the effective use of the colon in writing crisp code. This paper presents real-time applications of the colon in day-to-day programming. In addition, this paper presents cases where the colon limits programmers' wishes.
Read the paper (PDF).
Jinson Erinjeri, EMMES Corporation
D
Paper 2523-2015:
DS2 with Both Hands on the Wheel
The DATA Step has served SAS® programmers well over the years, and although it is handy, the new, exciting, and powerful DS2 is a significant alternative to the DATA Step by introducing an object-oriented programming environment. It enables users to effectively manipulate complex data and efficiently manage the programming through additional data types, programming structure elements, user-defined methods, and shareable packages, as well as threaded execution. This tutorial is developed based on our experiences with getting started with DS2 and learning to use it to access, manage, and share data in a scalable and standards-based way. It facilitates SAS users of all levels to easily get started with DS2 and understand its basic functionality by practicing the features of DS2.
Read the paper (PDF).
Peter Eberhardt, Fernwood Consulting Group Inc.
Xue Yao, Winnipeg Regional Health Aurthority
Paper 2000-2015:
Data Aggregation Using the SAS® Hash Object
Soon after the advent of the SAS® hash object in SAS® 9.0, its early adopters realized that the potential functionality of the new structure is much broader than basic 0(1)-time lookup and file matching. Specifically, they went on to invent methods of data aggregation based on the ability of the hash object to quickly store and update key summary information. They also demonstrated that the DATA step aggregation using the hash object offered significantly lower run time and memory utilization compared to the SUMMARY/MEANS or SQL procedures, coupled with the possibility of eliminating the need to write the aggregation results to interim data files and the programming flexibility that allowed them to combine sophisticated data manipulation and adjustments of the aggregates within a single step. Such developments within the SAS user community did not go unnoticed by SAS R&D, and for SAS® 9.2 the hash object had been enriched with tag parameters and methods specifically designed to handle aggregation without the need to write the summarized data to the PDV host variable and update the hash table with new key summaries, thus further improving run-time performance. As more SAS programmers applied these methods in their real-world practice, they developed aggregation techniques fit to various programmatic scenarios and ideas for handling the hash object memory limitations in situations calling for truly enormous hash tables. This paper presents a review of the DATA step aggregation methods and techniques using the hash object. The presentation is intended for all situations in which the final SAS code is either a straight Base SAS DATA step or a DATA step generated by any other SAS product.
Read the paper (PDF).
Paul Dorfman, Dorfman Consukting
Don Henderson, Henderson Consulting Services
Paper 2460-2015:
Demystifying Date and Time Intervals
Intervals have been a feature of Base SAS® for a long time, enabling SAS users to work with commonly (and not-so-commonly) defined periods of time such as years, months, and quarters. With the release of SAS®9, there are more options and capabilities for intervals and their functions. This paper first discusses the basics of intervals in detail, and then discusses several of the enhancements to the interval feature, such as the ability to select how the INTCK function defines interval boundaries and the ability to create your own custom intervals beyond multipliers and shift operators.
Read the paper (PDF).
Derek Morgan
Paper SAS1935-2015:
Divide and Conquer--Writing Parallel SAS® Code to Speed Up Your SAS Program
Being able to split SAS® processing over multiple SAS processers on a single machine or over multiple machines running SAS, as in the case of SAS® Grid Manager, enables you to get more done in less time. This paper looks at the methods of using SAS/CONNECT® to process SAS code in parallel, including the SAS statements, macros, and PROCs available to make this processing easier for the SAS programmer. SAS products that automatically generate parallel code are also highlighted.
Read the paper (PDF). | Download the data file (ZIP).
Doug Haigh, SAS
Paper SAS1561-2015:
Driving SAS® with Lua
Programming SAS® has just been made easier, now that SAS 9.4 has incorporated the Lua programming language into the heart of the SAS System. With its elegant syntax, modern design, and support for data structures, Lua offers you a fresh way to write SAS programs, getting you past many of the limitations of the SAS macro language. This paper shows how you can get started using Lua to drive SAS, via a quick introduction to Lua and a tour through some of the features of the Lua and SAS combination that make SAS programming easier. SAS macro programming is also compared with Lua, so that you can decide where you might benefit most by using either language.
Read the paper (PDF).
Paul Tomas, SAS
Paper SAS1787-2015:
Dynamic Decision-Making Web Services Using SAS® Stored Processes and SAS® Business Rules Manager
With the latest release of SAS® Business Rules Manager, decision-making using SAS® Stored Processes is now easier with simplified deployment via a web service for integration with your applications and business processes. This paper shows you how a user can publish analytics and rules as SOAP-based web services, track its usage, and dynamically update these decisions using SAS Business Rules Manager. In addition, we demonstrate how to integrate with SAS® Model Manager using SAS® Workflow to demonstrate how your other SAS® applications and solutions can also simplify real-time decision-making through business rules.
Read the paper (PDF).
Lori Small, SAS
Chris Upton, SAS
E
Paper 3502-2015:
Edit the Editor: Creating Keyboard Macros in SAS® Enterprise Guide®
Programmers can create keyboard macros to perform common editing tasks in SAS® Enterprise Guide®. This paper introduces how to record keystrokes, save a keyboard macro, edit the commands, and assign a shortcut key. Sample keyboard macros are included. Techniques to share keyboard macros are also covered.
Read the paper (PDF). | Download the data file (ZIP).
Christopher Bost, MDRC
Paper 3047-2015:
Examination of Three SAS® Tools for Solving a Complicated Data Summary Problem
When faced with a difficult data reduction problem, a SAS® programmer has many options for how to solve the problem. In this presentation, three different methods are reviewed and compared in terms of processing time, debugging, and ease of understanding. The three methods include linearizing the data, using SQL Cartesian joins, and using sequential data processing. Inconsistencies in the raw data caused the data linearization to be problematic. The large number of records and the need for many-to-many merges resulted in a long run time for the SQL code. The sequential data processing, although older technology, provided the most time efficient and error-free results.
Read the paper (PDF).
Carry Croghan, US-EPA
F
Paper 3380-2015:
From a One-Horse to a One-Stoplight Town: A Base SAS® Solution to Preventing Data Access Collisions Using Shared and Exclusive File Locks
Data access collisions occur when two or more processes attempt to gain concurrent access to a single data set. Collisions are a common obstacle to SAS® practitioners in multi-user environments. As SAS instances expand to infrastructures and ultimately empires, the inherent increased complexities must be matched with commensurately higher code quality standards. Moreover, permanent data sets will attract increasingly more devoted users and automated processes clamoring for attention. As these dependencies increase, so too does the likelihood of access collisions that, if unchecked or unmitigated, lead to certain process failure. The SAS/SHARE® module offers concurrent file access capabilities, but causes a (sometimes dramatic) reduction in processing speed, must be licensed and purchased separately from Base SAS®, and is not a viable solution for many organizations. Previously proposed solutions in Base SAS use a busy-wait spinlock cycle to repeatedly attempt file access until process success or timeout. While effective, these solutions are inefficient because they generate only read-write locked data sets that unnecessarily prohibit access by subsequent read-only requests. This presentation introduces the %LOCKITDOWN macro that advances previous solutions by affording both read-write and read-only lock testing and deployment. Moreover, recognizing the responsibility for automated data processes to be reliable, robust, and fault tolerant, %LOCKITDOWN is demonstrated in the context of a macro-based exception handling paradigm.
Read the paper (PDF).
Troy Hughes, Datmesis Analytics
G
Paper SAS2602-2015:
Getting Started with Enabling Your End-User Applications to Use SAS® Grid Manager 9.4
A SAS® Grid Manager environment provides your organization with a powerful and flexible way to manage many forms of SAS® computing workloads. For the business and IT user community, the benefits can range from data management jobs effectively utilizing the available processing resources, complex analyses being run in parallel, and reassurance that statutory reports are generated in a highly available environment. This workshop begins the process of familiarizing users with the core concepts of how to grid-enable tasks within SAS® Studio, SAS® Enterprise Guide®, SAS® Data Integration Studio, and SAS® Enterprise Miner™ client applications.
Edoardo Riva, SAS
Paper 3474-2015:
Getting your SAS® Program to Do Your Typing for You!
Do you have a SAS® program that requires adding filenames to the input every time you run it? Aren't you tired of having to check for the files, check the names, and type them in? Check out how my SAS® Enterprise Guide® project checks for files, figures out the file names, and saves me from having to type in the file names for the input data files!
Read the paper (PDF). | Download the data file (ZIP).
Nancy Wilson, Ally
H
Paper 2506-2015:
Hands-on SAS® Macro Programming Essentials for New Users
The SAS® Macro Language is a powerful tool for extending the capabilities of the SAS® System. This hands-on workshop teaches essential macro coding concepts, techniques, tips, and tricks to help beginning users learn the basics of how the macro language works. Using a collection of proven macro language coding techniques, attendees learn how to write and process macro statements and parameters; replace text strings with macro (symbolic) variables; generate SAS code using macro techniques; manipulate macro variable values with macro functions; create and use global and local macro variables; construct simple arithmetic and logical expressions; interface the macro language with the SQL procedure; store and reuse macros; troubleshoot and debug macros; and develop efficient and portable macro language code.
Read the paper (PDF).
Kirk Paul Lafler, Software Intelligence Corporation
Paper SAS1747-2015:
Helping You C What You Can Do with SAS®
SAS® users are already familiar with the FCMP procedure and the flexibility it provides them in writing their own functions and subroutines. However, did you know that FCMP also allows you to call functions written in C? Did you know that you can create and populate complex C structures and use C types in FCMP? With the PROTO procedure, you can define function prototypes, structures, enumeration types, and even small bits of C code. This paper gets you started on how to use the PROTO procedure and, in turn, how to call your C functions from within FCMP and SAS.
Read the paper (PDF). | Download the data file (ZIP).
Andrew Henrick, SAS
Karen Croft, SAS
Donald Erdman, SAS
Paper 3273-2015:
How to Create a UNIX Space Management Report Using SAS®
Storage space on a UNIX platform is a costly--and finite--resource to maintain, even under ideal conditions. By regularly monitoring and promptly responding to space limitations that might occur during production, an organization can mitigate the risk of wasted expense, time and effort caused by this problem. SAS® programmers at Truven Health Analytics have designed a reporting tool to measure space usage by a number of distinct factors over time. Using tabular and graphical output, the tool provides a full picture of what often contributes to critical reductions of available hardware space. It enables managers and users to respond appropriately and effectively whenever this occurs. It also helps to identify ways to encourage more efficient practices, thereby minimizing the likelihood of this occurring in the future. Operating System: RHEL 5.4 (Red Hat Enterprise Linux), Oracle Sun Fire X4600 M2 SAS® 9.3 TS1M1.
Matthew Shevrin, Truven Health Analytcis
Paper 3143-2015:
How to Cut the Time of Processing of Ryan White Services (RSR) Data by 99% and More.
The widely used method to convert RSR XML data to some standard, ready-to-process database uses a Visual Basic mapper as a buffer tool when reading XML data (for example, into an MS Access database). This paper describes the shortcomings of this method with respect to the different schemas of RSR data and offers a SAS® macro that enables users to read any schema of RSR data directly into a SAS relational database. This macro entirely eliminates the step of creating an MS Access database. Using our macro, the user can cut the time of processing of Ryan White data by 99% and more, depending on the number of files that need to be processed in one run.
Read the paper (PDF).
Michael Costa, Abt Associates
Fizza Gillani, Brown University and Lifespan/Tufts/Brown Center for AIDS Research.
I
Paper 2522-2015:
I Object: SAS® Does Objects with DS2
The DATA step has served SAS® programmers well over the years, and although it is powerful, it has not fundamentally changed. With DS2, SAS introduced a significant alternative to the DATA step by providing an object-oriented programming environment. In this paper, we share our experiences with getting started with DS2 and learning to use it to access, manage, and share data in a scalable, threaded, and standards-based way.
Read the paper (PDF).
Peter Eberhardt, Fernwood Consulting Group Inc.
Xue Yao, Winnipeg Regional Health Aurthority
Paper 2120-2015:
Inside the DATA Step: Pearls of Wisdom for the Novice SAS® Programmer
Why did my merge fail? How did that variable get truncated? Why am I getting unexpected results? Understanding how the DATA step actually works is the key to answering these and many other questions. In this paper, two independent consultants with a combined three decades of SAS® programming experience share a treasure trove of knowledge aimed at helping the novice SAS programmer take his or her game to the next level by peering behind the scenes of the DATA step. We touch on a variety of topics, including compilation versus execution, the program data vector, and proper merging techniques, with a focus on good programming practices that help the programmer steer clear of common pitfalls.
Read the paper (PDF).
Joshua Horstman, Nested Loop Consulting
Britney Gilbert, Juniper Tree Consulting
Joshua Horstman, Nested Loop Consulting
Paper 3461-2015:
Integrating Data and Business Rules with a Control Data Set in SAS®
In SAS® software development, data specifications and process requirements can be built into user-defined control data set functioning as components of ETL routines. A control data set provides comprehensive definition on the data source, relationship, logic, description, and metadata of each data element. This approach facilitates auto-generated SAS codes during program execution to perform data ingestion, transformation, and loading procedures based on rules defined in the table. This paper demonstrates the application of using a control data set for the following: (1) data table initialization and integration; (2) validation and quality control; (3) element transformation and creation; (4) data loading; and (5) documentation. SAS programmers and business analysts would find programming development and maintenance of business rules more efficient with this standardized method.
Read the paper (PDF).
Edmond Cheng, CACI International Inc
Paper 3024-2015:
Introduction to SAS® Hash Objects
The SAS® hash object is an incredibly powerful technique for integrating data from two or more data sets based on a common key. This session describes the basic methodology for defining, populating, and using a hash object to perform lookups within the DATA step and provides examples of situations in which the performance of SAS programs is improved by their use. Common problems encountered when using hash objects are explained, and tools and techniques for optimizing hash objects within your SAS program are demonstrated.
Read the paper (PDF).
Chris Schacherer, Clinical Data Management Systems, LLC
L
Paper 3372-2015:
Leads and Lags: Static and Dynamic Queues in the SAS® DATA Step
From stock price histories to hospital stay records, analysis of time series data often requires the use of lagged (and occasionally lead) values of one or more analysis variables. For the SAS® user, the central operational task is typically getting lagged (lead) values for each time point in the data set. Although SAS has long provided a LAG function, it has no analogous lead function--an especially significant problem in the case of large data series. This paper reviews the LAG function (in particular, the powerful but non-intuitive implications of its queue-oriented basis), demonstrates efficient ways to generate leads with the same flexibility as the LAG function (but without the common and expensive recourse of data re-sorting), and shows how to dynamically generate leads and lags through the use of the hash object.
Read the paper (PDF). | Download the data file (ZIP).
Mark Keintz, Wharton Research Data Services
Paper 1408-2015:
Learn Hidden Ideas in Base SAS® to Impress Colleagues
Across the languages of SAS® are many golden nuggets--functions, formats, and programming features just waiting to impress your friends and colleagues. Learning SAS over 30+ years, I have collected a few, and I offer them to you in this presentation.
Read the paper (PDF).
Peter Crawford, Crawford Software Consultancy Limited
N
Paper SAS1575-2015:
New Macro Features Added in SAS® 9.3 and SAS® 9.4
This paper describes the new features added to the macro facility in SAS® 9.3 and SAS® 9.4. New features described include the /READONLY option for macro variables, the %SYSMACEXIST macro function, the %PUT &= feature, and new automatic macro variables such as &SYSTIMEZONEOFFSET.
Read the paper (PDF).
Rick Langston, SAS
O
Paper 2680-2015:
Object Oriented Program Design in DS2
The DS2 programming language was introduced as part of the SAS® 9.4 release. Although this new language introduced many significant advancements, one of the most overlooked features is the addition of object-oriented programming constructs. Specifically, the addition of user-defined packages and methods enables programmers to create their own objects, greatly increasing the opportunity for code reuse and decreasing both development and QA duration. In addition, using this object-oriented approach provides a powerful design methodology where objects closely resemble the real-world entities that they model, leading to programs that are easier to understand and maintain. This paper introduces the object-oriented programming paradigm in a three-step manner. First, the key object-oriented features found in the DS2 language are introduced, and the value each provides is discussed. Next, these object-oriented concepts are demonstrated through the creation of a blackjack simulation where the players, the dealer, and the deck are modeled and coded as objects. Finally, a credit risk scoring object is presented to demonstrate the application of this approach in a real-world setting.
Read the paper (PDF).
Shaun Kaufmann, Farm Credit Canada
Q
Paper 2221-2015:
Quotes within Quotes: When Single (') and Double (") Quotes Are Not Enough
Although it does not happen every day, it is not unusual to need to place a quoted string within another quoted string. Fortunately, SAS® recognizes both single and double quote marks and either can be used within the other, which gives you the ability to have two-deep quoting. There are situations, however, where two kinds of quotes are not enough. Sometimes you need a third layer or, more commonly, you need to use a macro variable within the layers of quotes. Macro variables can be especially problematic, because they generally do not resolve when they are inside single quotes. However, this is SAS and that implies that there are several things going on at once and that there are several ways to solve these types of quoting problems. The primary goal of this presentation is to assist the programmer with solutions to the quotes-within-quotes problem with special emphasis on the presence of macro variables. The various techniques are contrasted as are the likely situations that call for these types of solutions. A secondary goal of this presentation is to help you understand how SAS works with quote marks and how it handles quoted strings. Without going into the gory details, a high-level understanding can be useful in a number of situations.
Read the paper (PDF).
Art Carpenter, California Occidental Consultants
R
Paper SAS1927-2015:
REST At Ease with SAS®: How to Use SAS to Get Your REST
REST is being used across the industry for designing networked applications to provide lightweight and powerful alternatives to web services such as SOAP and Web Services Description Language (WSDL). Since REST is based entirely around HTTP, SAS® provides everything you need to make REST calls and process structured and unstructured data alike. Learn how PROC HTTP and other SAS language features provide everything you need to simply and securely make use of REST.
Read the paper (PDF).
Joseph Henry, SAS
Paper 2102-2015:
Reversing the IN Operator
The IN operator within the DATA step is used for searching a specific variable for some values, either numeric or character (for example, 'if X in (2), then...'). This brief note explains how the opposite situation can be managed. That is, it explains how to search for a specific value in several variables through applying an array and the IN operator together.
Read the paper (PDF).
Can Tongur, Statistics Sweden
S
Paper 3444-2015:
S-M-U (Set, Merge, and Update) Revisited
It is a safe assumption that almost every SAS® user learns how to use the SET statement not long after they're taught the concept of a DATA step. Further, it would probably be reasonable to guess that almost everyone of those people covered the MERGE statement soon afterwards. Many, maybe most, also got to try the UPDATE and/or MODIFY statements eventually, as well. It would also be a safe assumption that very few people have taken the time to review the manual since they've learned about those statements. That is most unfortunate, because there are so many options available to the users that can assist them in their tasks of obtaining and combining data sets. This presentation is designed to build onto the basic understanding of SET, MERGE, and UPDATE. It assumes that the attendee or reader has a basic knowledge of those statements, and it introduces various options and usages that extend the utility of these basic commands.
Read the paper (PDF).
Andrew Kuligowski, HSN
Paper 2540-2015:
SAS® Enterprise Guide® System Design
A good system should embody the following characteristics: planned, maintainable, flexible, simple, accurate, restartable, reliable, reusable, automated, documented, efficient, modular, and validated. This is true of any system, but how to implement this in SAS® Enterprise Guide® is a unique endeavor. We provide a brief overview of these characteristics and then dive deeper into how a SAS Enterprise Guide user should approach developing both ad hoc and production systems.
Read the paper (PDF).
Steven First, Systems Seminar Consultants
Jennifer First-Kluge, Systems Seminar Consultants
Paper 2683-2015:
SAS® Enterprise Guide® or SAS® Studio: Which is Best for You?
SAS® Studio (previously known as SAS® Web Editor) was introduced in the first maintenance release of SAS® 9.4 as an alternative programming environment to SAS® Enterprise Guide® and SAS® Display Manager. SAS Studio is different in many ways from SAS Enterprise Guide and SAS Display Manager. As a programmer, I currently use SAS Enterprise Guide to help me code, test, maintain, and organize my SAS® programs. I have SAS Display Manager installed on my PC, but I still prefer to write my programs in SAS Enterprise Guide because I know it saves my log and output whenever I run a program, even if that program crashes and takes the SAS session with it! So should I now be using SAS Studio instead, and should you be using it, too?
Read the paper (PDF).
Philip Holland, Holland Numerics Limited
Paper 3316-2015:
Sending Text Messages to your Phone via the DATA Step
Text messages (SMS) are a convenient way to receive notifications away from your computer screen. In SAS®, text messages can be sent to mobile phones via the DATA step. This paper briefly describes several methods for sending text messages from SAS and explores possible applications.
Read the paper (PDF).
Matthew Slaughter, Coalition for Compassionate Care of California
Paper 2264-2015:
Some of the Most Useful SAS® Functions
SAS® functions provide amazing power to your DATA step programming. Specific functions are essential--they save you from writing volumes of unnecessary code. This presentation covers some of the most useful SAS functions. A few might be new to you and they can all change how you program and approach common programming tasks. The majority of these functions work with character data. There are functions that search for strings, others that find and replace strings, and some that join strings together. Furthermore, certain functions can measure the spelling distance between two strings (useful for fuzzy matching). Some of the newest and most incredible functions are not functions at all--they are call routines. Did you know that you can sort values within an observation? Did you know that not only can you identify the largest or smallest value in a list of variables, but you can identify the second or third or nth largest or smallest value? A knowledge of these functions will make you a better SAS programmer.
Read the paper (PDF).
Ron Cody, Camp Verde Consulting
Paper SAS1890-2015:
Someone Changed My SAS® Visual Analytics Report! How an Automated Version Control Process Can Rescue Your Report and Save Your Sanity
Your enterprise SAS® Visual Analytics implementation is on its way to being adopted throughout your organization, unleashing the production of critical business content by business analysts, data scientists, and decision makers from many business units. This content is relied upon to inform decisions and provide insight into the results of those decisions. With the development of SAS Visual Analytics content decentralized into the hands of business users, the use of automated version control is essential to providing protection and recovery in the event of inadvertent changes to that content. Re-creation of complex report objects accidentally modified by a business user is time-consuming and can be eliminated by maintaining a version control repository of report (and other) objects created in SAS Visual Analytics. This paper walks through the steps for implementing an automated process for version control using SAS®. This process can be applied to all types of metadata objects used in multiple SAS application development and analysis environments, such as reports and explorations from SAS Visual Analytics, and jobs, tables, and libraries from SAS® Data Integration Studio. Basic concepts for the process, as well as specific techniques used for our implementation are included. So eliminate the risk of content loss for your business users and the burden of manual version control for your applications developers. Your IT shop will enjoy time savings and greater reliability.
Read the paper (PDF).
Jerry Hosking, SAS
Paper 1978-2015:
Something for Nothing? Adding Group Descriptive Statistics Using SAS® PROC SQL Subqueries II
Can you actually get something for nothing? With the SAS® PROC SQL subquery and remerging features, yes, you can. When working with categorical variables, you often need to add group descriptive statistics such as group counts and minimum and maximum values for further BY-group processing. Instead of first creating the group count and minimum or maximum values and then merging the summarized data set to the original data set, why not take advantage of PROC SQL to complete two steps in one? With the PROC SQL subquery and summary functions by the group variable, you can easily remerge the new group descriptive statistics with the original data set. Now with a few DATA step enhancements, you too can include percent calculations.
Read the paper (PDF).
Sunil Gupta, Gupta Programming
Paper 1565-2015:
Strategies for Error Handling and Program Control: Concepts
SAS® provides a complex ecosystem with multiple tools and products that run in a variety of environments and modes. SAS provides numerous error-handling and program control statements, options, and features. These features can function differently according to the run environment, and many of them have constraints and limitations. In this presentation, we review a number of potential error-handling and program control strategies that can be employed, along with some of the inherent limitations of each. The bottom line is that there is no single strategy that will work in all environments, all products, and all run modes. Instead, programmers need to consider the underlying program requirements and choose the optimal strategy for their situation.
Read the paper (PDF). | Download the data file (ZIP).
Thomas Billings, MUFG Union Bank, N.A.
Paper 3187-2015:
Structuring your SAS® Applications for Long-Term Survival: Reproducible Methods in Base SAS® Programming
SAS® users organize their applications in a variety of ways. However, there are some approaches that are more successful, and some that are less successful. In particular, the need to process some of the code some of the time in a file is sometimes challenging. Reproducible research methods require that SAS applications be understandable by the author and other staff members. In this presentation, you learn how to organize and structure your SAS application to manage the process of data access, data analysis, and data presentation. The approach to structure applications requires that tasks in the process of data analysis be compartmentalized. This can be done using a well-defined program. The author presents his structuring algorithm, and discusses the characteristics of good structuring methods for SAS applications. Reproducible research methods are becoming more centrally important, and SAS users must keep up with the current developments.
Read the paper (PDF). | Download the data file (ZIP).
Paul Thomas, ASUP Ltd
T
Paper 2219-2015:
Table Lookup Techniques: From the Basic to the Innovative
One of the more commonly needed operations in SAS® programming is to determine the value of one variable based on the value of another. A series of techniques and tools have evolved over the years to make the matching of these values go faster, smoother, and easier. A majority of these techniques require operations such as sorting, searching, and comparing. As it turns out, these types of techniques are some of the more computationally intensive. Consequently, an understanding of the operations involved and a careful selection of the specific technique can often save the user a substantial amount of computing resources. Many of the more advanced techniques can require substantially fewer resources. It is incumbent on the user to have a broad understanding of the issues involved and a more detailed understanding of the solutions available. Even if you do not currently have a BIG data problem, you should at the very least have a basic knowledge of the kinds of techniques that are available for your use.
Read the paper (PDF).
Art Carpenter, California Occidental Consultants
Paper SAS1831-2015:
Teach Them to Fish--How to Use Tasks in SAS® Studio to Enable Co-Workers to Run Your Reports Themselves
How many times has this happened to you? You create a really helpful report and share it with others. It becomes popular and you find yourself running it over and over. Then they start asking, But can't you re-run it and just change ___? (Fill in the blank with whatever simple request you can think of.) Don't you want to just put the report out as a web page with some basic parameters that users can choose themselves and run when they want? Consider writing your own task in SAS® Studio! SAS Studio includes several predefined tasks, which are point-and-click user interfaces that guide the user through an analytical process. For example, tasks enable users to create a bar chart, run a correlation analysis, or rank data. When a user selects a task option, SAS® code is generated and run on the SAS server. Because of the flexibility of the task framework, you can make a copy of a predefined task and modify it or create your own. Tasks use the same common task model and the Velocity Template Language--no Java programming or ActionScript programming is required. Once you have the interface set up to generate the SAS code you need, then you can publish the task for other SAS Studio users to use or you can use a straight URL. Now that others can generate the output themselves, you actually might have time to go fishing!
Read the paper (PDF).
Christie Corcoran, SAS
Amy Peters, SAS
Paper 3106-2015:
The Best DATA Step Debugging Feature
Many languages, including the SAS DATA step, have extensive debuggers that can be used to detect logic errors in programs. Another easy way to detect logic errors is to simply display messages and variable content at strategic times. The PUTLOG statement will be discussed and examples given that show how using this statement is probably the easiest and most flexible way to detect and correct errors in your DATA step logic.
Read the paper (PDF).
Steven First, Systems Seminar Consultants
Paper 1334-2015:
The Essentials of SAS® Dates and Times
The first thing that you need to know is that SAS® software stores dates and times as numbers. However, this is not the only thing that you need to know, and this presentation gives you a solid base for working with dates and times in SAS. It also introduces you to functions and features that enable you to manipulate your dates and times with surprising flexibility. This paper also shows you some of the possible pitfalls with dates (and with times and datetimes) in your SAS code, and how to avoid them. We show you how SAS handles dates and times through examples, including the ISO 8601 formats and informats, and how to use dates and times in TITLE and FOOTNOTE statements. We close with a brief discussion of Microsoft Excel conversions.
Read the paper (PDF). | Download the data file (ZIP).
Derek Morgan
Paper 3060-2015:
The Knight's Tour in Chess--Implementing a Heuristic Solution
The knight's tour is a sequence of moves on a chess board such that a knight visits each square only once. Using a heuristic method, it is possible to find a complete path, beginning from any arbitrary square on the board and landing on the remaining squares only once. However, the implementation poses challenging programming problems. For example, it is necessary to discern viable knight moves, which change throughout the tour. Even worse, the heuristic approach does not guarantee a solution. This paper explains a SAS® solution that finds a knight's tour beginning from every initial square on a chess board...well, almost.
Read the paper (PDF).
John R Gerlach, Dataceutics, Inc.
Paper SAS1956-2015:
The SAS® Scalable Performance Data Engine: Moving Your Data to Hadoop without Giving Up the SAS Features You Depend On
If you are one of the many customers who want to move your SAS® data to Hadoop, one decision you will encounter is what data storage format to use. There are many choices, and all have their pros and cons. One factor to consider is how you currently store your data. If you currently use the Base SAS® engine or the SAS® Scalable Performance Data Engine, then using the SPD Engine with Hadoop will enable you to continue accessing your data with as little change to your existing SAS programs as possible. This paper discusses the enhancements, usage, and benefits of the SPD Engine with Hadoop.
Read the paper (PDF).
Lisa Brown, SAS
Paper 3003-2015:
Tips and Tricks for SAS® Program Automation
There are many 'gotcha's' when you are trying to automate a well-written program. The details differ depending on the way you schedule the program and the environment you are using. This paper covers system options, error handling logic, and best practices for logging. Save time and frustration by using these tips as you schedule programs to run.
Read the paper (PDF).
Adam Hood, Slalom Consulting
U
Paper 3285-2015:
Unraveling the Knot of Ampersands
We've all heard it before: 'If two ampersands don't work, add a third.' But how many of us really know how ampersands work behind the scenes? We show the function of multiple ampersands by going through examples of the common two- and three-ampersand scenarios, and expand to show four, five, six, and even seven ampersands, and explain when they might be (rarely) useful.
Read the paper (PDF).
Joe Matise, NORC at the University of Chicago
W
Paper 3387-2015:
Why Aren't Exception Handling Routines Routine? Toward Reliably Robust Code through Increased Quality Standards in Base SAS®
A familiar adage in firefighting--if you can predict it, you can prevent it--rings true in many circles of accident prevention, including software development. If you can predict that a fire, however unlikely, someday might rage through a structure, it's prudent to install smoke detectors to facilitate its rapid discovery. Moreover, the combination of smoke detectors, fire alarms, sprinklers, fire-retardant building materials, and rapid intervention might not prevent a fire from starting, but it can prevent the fire from spreading and facilitate its immediate and sometimes automatic extinguishment. Thus, as fire codes have grown to incorporate increasingly more restrictions and regulations, and as fire suppression gear, tools, and tactics have continued to advance, even the harrowing business of firefighting has become more reliable, efficient, and predictable. As operational SAS® data processes mature over time, they too should evolve to detect, respond to, and overcome dynamic environmental challenges. Erroneous data, invalid user input, disparate operating systems, network failures, memory errors, and other challenges can surprise users and cripple critical infrastructure. Exception handling describes both the identification of and response to adverse, unexpected, or untimely events that can cause process or program failure, as well as anticipated events or environmental attributes that must be handled dynamically through prescribed, predetermined channels. Rapid suppression and automatic return to functioning is the hopeful end state but, when catastrophic events do occur, exception handling routines can terminate a process or program gracefully while providing meaningful execution and environmental metrics to developers both for remediation and future model refinement. This presentation introduces fault-tolerant Base SAS® exception handling routines that facilitate robust, reliable, and responsible software design.
Read the paper (PDF).
Troy Hughes, Datmesis Analytics
Paper 3390-2015:
Working with PROC FEDSQL in SAS® 9.4
Working with multiple data sources in SAS® was not a straight forward thing until PROC FEDSQL was introduced in the SAS® 9.4 release. Federated Query Language, or FEDSQL, is a vendor-independent language that provides a common SQL syntax to communicate across multiple relational databases without having to worry about vendor-specific SQL syntax. PROC FEDSQL is a SAS implementation of the FEDSQL language. PROC FEDSQL enables us to write federated queries that can be used to perform joins on tables from different databases with a single query, without having to worry about loading the tables into SAS individually and combining them using DATA steps and PROC SQL statements. The objective of this paper is to demonstrate the working of PROC FEDSQL to fetch data from multiple data sources such as Microsoft SQL Server database, MySQL database, and a SAS data set, and run federated queries on all the data sources. Other powerful features of PROC FEDSQL such as transactions and FEDSQL pass-through facility are discussed briefly.
Read the paper (PDF).
Zabiulla Mohammed, Oklahoma State University
Ganesh Kumar Gangarajula, Oklahoma State University
Pradeep Reddy Kalakota, Federal Home Loan Bank of Desmoines
Y
Paper 3259-2015:
You Deserve ARRAYS: How to Be More Efficient Using SAS®!
Everyone likes getting a raise, and using ARRAYs in SAS® can help you do just that! Using ARRAYs simplifies processing, allowing for reading and analyzing of repetitive data with minimum coding. Improving the efficiency of your coding and in turn, your SAS productivity, is easier than you think! ARRAYs simplify coding by identifying a group of related variables that can then be referred to later in a DATA step. In this quick tip, you learn how to define an ARRAY using an array statement that establishes the ARRAY name, length, and elements. You also learn the criteria and limitations for the ARRAY name, the requirements for array elements to be processed as a group, and how to call an ARRAY and specific array elements within a DATA step. This quick tip reveals useful functions and operators, such as the DIM function and using the OF operator within existing SAS functions, that make using ARRAYs an efficient and productive way to process data. This paper takes you through an example of how to do the same task with and without using ARRAYs in order to illustrate the ease and benefits of using them. Your coding will be more efficient and your data analysis will be more productive, meaning you will deserve ARRAYs!
Read the paper (PDF).
Kate Burnett-Isaacs, Statistics Canada
Paper 2004-2015:
Your Database Can Do SAS®, Too!
How often have you pulled oodles of data out of the corporate data warehouse down into SAS® for additional processing? This additional processing, sometimes thought to be uniquely SAS, might include FIRST. logic, cumulative totals, lag functionality, specialized summarization, or advanced date manipulation. Using the analytical (or OLAP) and Windowing functionality available in many databases (for example, in Teradata and IBM Netezza ), all of this processing can be performed directly in the database without moving and reprocessing detail data unnecessarily. This presentation illustrates how to increase your coding and execution efficiency by using the database's power through your SAS environment.
Read the paper (PDF).
Harry Droogendyk, Stratia Consutling Inc.
back to top