SAS Programming
This section contains papers that discuss and demonstrate various techniques for appropriate for SAS Programmers.
-
A Comparison of SAS versus Microsoft Excel and Access’s Inbuilt VBA Functionality- Date:
- 07 November 2011
There are a great variety of business situations where it is necessary to automatically export data from a large number of similar Microsoft® Excel spreadsheets (perhaps reports, forms etc.) into a central database, without access to a SAS® installation. This paper will show how to use Microsoft® Excel and Microsoft® Access’s inbuilt VBA functionality to program this type of export.
-
The Perl in the Crown: Regular Expressions in SAS
- Date:
- 25 August 2011
This paper introduces the PRX family of SAS functions and call routines, which bring the power of Perl regular expressions to SAS. Examples are given of every member of the PRX family (apart from PRXDEBUG), as well as some undocumented features. No prior knowledge of Perl is required.
-
Twenty-Six Characters in Search of a Function
- Date:
- 13 May 2010
This paper provides a concise but comprehensive survey of all of SAS’s character functions and call routines, including the ones you never had time to investigate, and the new features that were documented in the “What’s New” notes you never had time to read properly.
-
Get Funky with %SYSFUNC
- Date:
- 26 February 2010
%SYSFUNC is a powerful macro function with respect to the manipulation of SAS data sets, external files and directories. In this paper we will discuss how to use SCL specific functions in a typical Base and Macro environment. By using simple examples we will illustrate the full capacity of this macro function in obtaining data set attributes, data set variable attributes, checking for existence of external files and how to read the contents of external directories.
-
An Introduction to the Macro Facility
- Date:
- 26 February 2010
The macro facility in the SAS System gives you extra functionality, more programming tools and a high level language for controlling Data Steps and Proc Steps. With the macro facility, you can pass values from step to step in normal SAS code, you can create bundles of SAS code to automate your work, and you can set up mechanisms for conditionally executing your SAS code. This paper introduces the macro facility and provides some basic SAS macro examples.
-
Hashing Performance Time with Hash Tables
- Date:
- 26 February 2010
This paper includes a basic discussion on the concept of hash tables and the theory that lies behind them. The main section will be a more practical approach into the definition and use of hash tables in SAS9. The later part of this paper will include a comparison between some traditional lookup methods (e.g.: formats, merge and SQL) and hash tables to try and convince any leftover sceptics of the full power of hash tables.
-
Proc SCAPROC - SAS Logging Unleashed
- Date:
- 26 February 2010
This paper describes the syntax of Proc SCAPROC, gives examples of the log files produced and demonstrates how thorough the procedure is at logging a wide spectrum of inputs and outputs. In addition, the paper compares SCAPROC logs to standard logs and demonstrates how a SAS program can be used to extract information from an SCAPROC log into a SAS data set. Although Proc SCAPROC can be used with the SAS grid job generator, this is outside the scope of the paper.
-
The SAS System in the Pharmaceutical Industry
- Date:
- 26 February 2010
This paper discusses the uses of the SAS System within the pharmaceutical industry. It offers suggestions for programming best practices and coding hints and tips along the way for young Statistician’s and Statistical Programmers. Finally an overview will be presented of Enterprise Guide and its use in the Pharmaceutical Industry.
-
To ODS RTF and Beyond
- Date:
- 26 February 2010
The Rich Text Format (RTF) specification is a method of encoding formatted text and graphics which is read by Microsoft Word and several other text editors. So now that we have the ability to send output to Word, how can we apply it? What are the advantages over traditional fixed space output? How can we go beyond the documentation to extract some of Microsoft Word’s features?
-
What NOT to code
- Date:
- 26 February 2010
I racked my brains for days, trying to think of a SAS topic on which I could truly claim expert knowledge. Finally it came to me: writing bad code. Not all the examples in this paper are my own. Colleagues at Amadeus have contributed generously, but wish to remain anonymous. One or two Amadeus clients may have have contributed as well, though without realising. They will definitely remain anonymous too.

