Browse for your favorite technical tips from SAS Tech Report, listed below by publication date. Or, visit the SAS Samples Home Page for access to other tips and samples.
Outputting the largest value in a BY-Group in SAS Enterprise Guide
This sample demonstrates how to use SAS Enterprise Guide can be used to output the largest value in a BY group.
How to Create a SAS Information Map That Filters Using Identity-Driven, Row-Level Permissions
This sample shows you how to define a simple identity-driven, row-level permission filter in SAS Information Map Studio. As the input table for the information map, this sample uses the SASHELP.CLASS table.
Sorting Text Without Regard to Case in SAS 9.2
This note reviews a seemingly simple problem that gets substantially easier to solve using new features of the Base SAS 9.2 SORT procedure.
Inserting a Blank Line After Every N Observations in PROC PRINT Output Using SAS 9.2
Learn a simple way to insert blank lines in SAS 9.2.
How to Add a Little Spice to Your PDF Output (PDF)
The ODS PRINTER statement (which includes the Printer, PCL, PostScript, and PDF destinations) is always trying to stay on top of changes and requests that users want. By staying on top, ODS can provide you the best possible output.
Viewing Current Style Settings for ODS HTML Output
To see the style definitions for your ODS HTML output, use the ODS MARKUP statement together with one of the utility tagsets described in this note.
The Output Delivery System (ODS) from Scratch (PDF)
In the paper, you'll learn how to generate multiple output formats, simultaneously; how to change the look of your report using styles; how to add text passages; and other “neat” tips (that is, helpful information).
Modernizing Your SAS Code: PROC FREQ Applications
Most SAS programmers have used the FREQ procedure, perhaps to evaluate basic data quality, but many valuable features of PROC FREQ are underutilized, even by experienced SAS users who turn to potentially complex routines when similar results could be produced with a simpler approach.
Customizing page numbers in the RTF destination
Beginning with SAS 9.1, page numbers can be customized in the RTF destination by using a variety of functions.
Scalability Solution for
SAS Dynamic Cluster Tables (PDF)
This paper provides an overview of dynamic cluster tables in SAS Scalable Performance Data Server 4.3 as well as enhancements that have been included in later releases.
A SAS Macro to Wrap Text
Sometimes it is desirable or even necessary to reformat long lines of text or code into fewer columns than the original document or program contained.
Turbo-Charging Spreadsheets (PDF)
This technical white paper shows how SAS Forecast Server can be accessed from Microsoft Excel using three new forecasting wizards in SAS Add-In for Microsoft Office.
Creating a Data Grid Like VB.NET
Tableeditor.tpl is a custom tagset that is created by the TEMPLATE procedure. The tableeditor tagset enables you to create HTML output with the same kind of functionality that you would get from Visual Basic .NET (VB.NET). You can easily export the output to Excel or other file types.
Avoid Entropy with the Ordered List Using SAS Enterprise Guide
SAS Enterprise Guide has a hidden gem of a feature ordered lists which lets you build simple lists of tasks from your project that you want to run in a prescribed sequence.
Manipulating Data with PROC SQL
This SQL Procedure tip illustrates how columns based on the numeric and character data types are defined; and how string functions, pattern matching, phonetic matching techniques, and a variety of other techniques are used with numeric and character data.
Creating Subfolders Using Hash Tables
This sample, provided by SAS user Richard Wright, will create subdirectories on the fly by walking down the hierarchy and creating the subdirectory if it doesn't exist.
What SAS Administrators Should Know about Libraries, Metadata, and SAS Enterprise Guide 4.1
This document provides details about changes and behaviors in SAS Enterprise Guide 4.1, and provides guidance to SAS administrators who would like to see the libraries behave in a certain way.
What Happened to My Data?
This paper helps you understand how results are affected when formatting is applied to classification variables.
Delivering SAS Graphs via SAS E-mail to a BlackBerry
SAS customer Dr. LeRoy Bessler shows you how to format a readable graph for a BlackBerry or any other small-screen device.
Moving Data from Here to There
Chris Hemedinger, co-author of the popular SAS for Dummies, offers an easy way to copy data from one SAS server to another, using SAS Enterprise Guide.
How Can I Get the Desired Ordering of My Data?
When ORDER=DATA is specified, PROC REPORT orders the GROUP/ORDER/ACROSS variable in order of appearance across all observations in the data set, not per grouping.
Troubleshooting an Installation of Platform Product Suite for SAS
This paper is intended to help you determine what has gone wrong during an installation of the Platform Product Suite for SAS.
Beyond the Basics: Advanced PROC REPORT Tips and Tricks
The paper cover topics that can be used with listing output and with the Output Delivery System (ODS); can be used only with an ODS destination; and highlight new features and changes for PROC REPORT in SAS 9.2.
Microsoft Visual Studio 2005 C# Code Snippets
These IntelliSense Code Snippets integrate into Microsoft Visual Studio 2005 to enable users to easily add common code for SAS Integration Technologies Windows Client to their projects.
Quarterly Updates of ZIP Code Data Set Available from SAS Maps Online
Now it's easier than ever to enhance your company's marketing strategy with up-to-date ZIP code data.
Dynamically determine the creation date and last modified date for an external file
Use the DIR command and FILENAME PIPE to dynamically determine the creation and last modified dates of an external file on Windows.
Create variable labels from data set values
Dynamically create variable labels from data set values and apply them using PROC DATASETS. This technique can also be used when reading flat files that contain a record you want to use for variable labels.
Create a new data set for each BY-Group in a data set.
Create multiple SAS data sets from one SAS data set based upon the value of the BY variable.
Defining an OLEDB Library in SAS Management Console Using Windows Authentication
This document explains how to define an OLEDB library in SAS Management Console in order to access the Microsoft SQL Server using Windows authentication.
Implementing a SAS Metadata Server Configuration for Use with SAS Enterprise Guide
This document explains how to install a server administered by a SAS Metadata Repository as a back-end server for your SAS Enterprise Guide client machines.
What is the Application Response Measurement (ARM)?
This FAQ provides a high-level description of the ARM standard, which is vendor-neutral and is targeted toward managing the performance of distributed applications.
How do I take advantage of the Application Response Measurement (ARM)?
This FAQ addresses using the ARM standard within SAS.
How do I use the SAS ARM macros?
This FAQ directs you to all of the information that you need to utilize the SAS ARM macros.
Opening a SAS SQL Server Database from SAS Enterprise Guide
This FAQ addresses problems with opening a SAS SQL database from SAS Enterprise Guide.
ETL Performance Tuning Tips (PDF)
This paper provides important ETL (extract, transform and load) performance, tuning and capacity information for SAS®9 and SAS Data Integration Studio. The report introduces ETL concepts and covers ETL performance topics in depth, using examples as needed.
Effect of Changes to Daylight Saving Time on SAS Software
Beginning in 2007, Daylight Saving Time will take effect on the second Sunday in March. Read this note to help determine if any of your SAS programs need modifications to accommodate this change. Foundation SAS uses the SAS private Java Runtime Environment (JRE). Don't miss the information about recommended updates for JREs, including the SAS private JRE.
Using MPRINT and MFILE Options to Expand Macros in SAS Code for Easier Debugging
You can use the MFILE and MPRINT options together to expand macros in SAS code and output the generated SAS code to an external text file.
SAS/GRAPH Dashboard Indicators
Explore this set of 10 downloadable samples for information about how to programmatically create dashboard indicators using the SAS language for display in SAS BI products.
Define an Oracle Library in SAS Management Console
This paper describes how to define an Oracle library in SAS Management Console and how to access the Oracle library from SAS Business Intelligence (BI) clients.
Best Practices for SAS®9 Metadata Server Change Control (PDF)
This paper identifies some best practices for implementing processes around the use of metadata promotion tools.
Backing Up SAS Content in Your SAS Enterprise Intelligence Platform (PDF)
This paper presents considerations for developing a content backup strategy for SAS Enterprise Intelligence Platform.
Partitioning of SAS Scalable Performance Data Server Tables (PDF)
The paper discusses partitioning standard SAS Scalable Performance Data Server tables and then uses the discussion as a basis to develop an understanding of how to partition dynamic cluster tables.
Using Temporary Tables to Upload and Join in a Database
This topic describes how to use the DBMSTEMP libname option to allow two libname statements to share a single connection to a database.
Securing SAS®9 Business Intelligence Content Managed in
Metadata (PDF)
This document describes how to set metadata permissions to manage and secure business intelligence content items such as stored processes, information maps, data explorations, Web reports and publication channels.
Installing and Starting a PC Spawner on Windows Operating Systems (PDF)
This document explains how to set user rights (which are required to start or install the program); install the spawner as a Windows service or by running it manually; and delete a spawner, as needed.
The ExcelXP Tagset and Microsoft Excel
This topic provides example code that uses the ExcelXP tagset to generate XML output.
Metadata Security and the DefaultACT in SAS®9
Read how SAS provided a flexible architecture that is not tied to a hierarchical structure.
Obtaining the Previous Value of a Variable Within a BY-Group
How Can I Retrieve the Program Name that is Currently Running in Batch or Interactively?
Calculating Group Totals and the Counts Within Each Group This sample uses the SUM() function to sum the AMOUNT column, creating a new column named GRPTOTAL with a COMMA10. format.
Enhanced Printing Capability for SAS/IML with the %PRINTIML Macro SAS/IML is an integral component of the SAS Intelligence Platform in that SAS/IML can read and write SAS data sets, just like the SAS DATA step.
What is the best way to protect the script file after I have added my user ID and password? To protect the script file when hardcoding the user ID and password within the file, use the access controls that are provided by your client operating system.
List all files that are located in a specific directory This macro will allow you to print all files or certain files with a particular extension.
How to Set a User or System Environment Variable Outside Command Context Created Within Windows Environment variables created by a set command within a Command or CMD session are not available as user or system-level environment variables outside the scope of the session in which they are created.
Creating a JSP TreeView This sample shows how to create and render a simple JSP TreeView using SAS AppDev Studio Java components.
Read zipped files into a SAS data set Use the Winzip Command Line Support Add-on and a FILENAME statement to read zipped files into a SAS data set.
How can I use PROC REPORT to link from one page in my PDF file to another? You can use PROC REPORT with CALL DEFINE to automate the process of linking to the anchored pages.
Overlay a plot line on a vertical bar chart Use the GBARLINE procedure to create bar line charts, which are vertical bar charts with a plot overlay.
Building a WHERE clause with multiple values selected from a List Box Control This sample demonstrates how to populate a list of values for the IN operator in a WHERE clause with multiple values selected from a List Box Control within a SAS/AF FRAME entry.
Change a character date value into a SAS date value Use SAS Enterprise Guide to convert a column from character to a SAS date.
How Can I Use PROC TRANSPOSE to Get One Record per BY Group? Because of the structure of a data set, using the BY statement does not always guarantee that PROC TRANSPOSE will create an output data set with one record per BY group.
Printing Text at the End of Every Page but the Last One in PROC REPORT A COMPUTE AFTER block is processed before the COMPUTE AFTER_PAGE_ on the last page.
Drop Variables from a SAS Data Set When All Its Values are Missing Use arrays and iterative DO loops to determine whether a variable's values are all missing.
Perform a Fuzzy Merge Within a Range Using DATA Step Component Objects Use the hash iterator to search a hash object for a value that is within a range from a second data set.
How Can I Create an Autocall Macro Library on the PC? An autocall library on the PC is simply a directory that contains noncompiled macro code.
Finding an Error in Macro Variable Resolution in Open Code by Using the %PUT Statement This example shows how to use %PUT statements to display macro variable values and messages in the SAS log. These statements help identify problems in creating a macro variable.
New Argument for Use with the COMPRESS Function The COMPRESS function allows you to remove selected characters from a character value.
How Can I Download an Excel File from an ODS HTML Web Page? You can place a download button on the HTML page that enables the reader to save the page as an Excel file.
How Can I Use PROC REPORT to Link from One Page in my PDF File to Another? Starting with SAS®9, the ANCHOR= statement inserts anchors into an ODS PDF output file. You can use PROC REPORT with CALL DEFINE to automate the process of linking to the anchored pages.
List All .SAS Files that are Located in a Specific Directory This macro will allow you to print all files or certain files with a particular extension. The macro accepts 2 parameters.
A Simple Server Monitoring Technique This tip demonstrates how to use SAS to detect UNIX and Windows server response anomalies, and then notify key personnel by e-mail or cell phone text messages.
DATA Step vs. PROC SQL: Issues with common variables when combining data sets (PDF) This paper offers general rules on how attributes and data values from two data sets are assigned for both the DATA Step and PROC SQL when you have common non-BY variables in both data sets.
Examining the Value of the YEARCUTOFF= System Option with GETOPTION This example demonstrates how to obtain information about a system option with the SAS function GETOPTION and how to use that information to control the processing of a program.
SAS Enterprise Guide Add-In task for creating a CSF graph The goal of this sample is to provide the files and steps required for adding an Enterprise Guide Add-In task which can be used to create a Critical Success Factor graph.
Using the ERROR Statement to Identify a Data Error This example shows how you can code an ERROR statement to customize error information written to the SAS log.
How Can I Password-Protect an ODS HTML Output File? There is not a way to password-protect an HTML file created by ODS HTML alone. Password-protecting files would usually require the use of a CGI. You can apply some simple JavaScript to an HTML pages to prevent unwanted viewers from getting to the page, but it is not totally secure.
Performing a Table Lookup with Large Nonindexed Data Sets Find out how to efficiently combine two data sets when one is a large data set whose retrieved values remain fairly constant.
PROC SQL Summary Functions PROC SQL is a wonderful tool for summarizing data. It provides a number of useful summary functions to help perform calculations, descriptive statistics, and other aggregating operations in a SELECT statement or HAVING clause.
Metadata Repositories Should be Backed up Correctly and Often Partial or incomplete backups of the Metadata Repository may result in the inability to restore the repository. Restoration may be required in the event of a corrupt repository. To successfully backup the Metadata Server, the server must be stopped or paused.
In ODS HTML, how can I freeze my table headers while I scroll the page? This FAQ provides numerous examples, organized into three sections: DATA step examples, ODS markup examples and Cascading Style Sheet (CSS) examples.
Can I remove the equal sign from the BY value in the table of contents for ODS output? The equal sign can be removed from the BY value in the table of contents by using the ODS MARKUP destination. The MARKUP destination gives you access to each piece of output. Therefore you can substring this value from the BY value using DATA step functions in SAS 9.1.
How to batch process Enterprise Guide 3.0 projects that will save results as HTML, MS Excel, and SAS tables (updated) The built-in scheduler in SAS Enterprise Guide 3.0 works nicely for automating a project to execute all its tasks; however, to take full advantage of the OLE Automation capabilities in SAS Enterprise Guide, a scripting language such as VBScript is required.
Manipulating Data with PROC SQL PROC SQL users have a number of ways available to accomplish their objectives, particularly when the goal is to manipulate data. Kirk Paul Lafler explains just a few of them in this tech tip.
Documenting the SAS Run Using SAShelp Tables David Cross, associate senior pharmacokinesticist at Eli Lilly, writes a lot of macros that input and output files based on parameters given to the high-order program. Take a look at his tech tip using SAShelp tables.
When do I use a WHERE statement vs. an IF statement to subset a data set? This tip shows you how and when to apply the WHERE and IF statements to get correct and reliable results.
Using a Single Macro Variable as a Macro Array The SAS macro language does not officially support the concept of an array. However, there is a simple technique that can be used to provide this functionality.
Customize the data set browser for the SAS Explorer window This sample explains how to customize the VIEWTABLE window such that the data set is opened in edit mode by default.
Resolving a macro variable within single quotes "Macro variables can be resolved between single quotes using %STR inside a %UNQUOTE function," explains SAS senior technical support analyst Russ Tyndall.
Combining SAS generation data sets into one SAS data set This sample describes how to obtain the information on how many generations exist and the maximum number of generations that can exist.
Registering a SAS MDDB in Batch This sample describes how to obtain the information on how many generations exist and the maximum number of generations that can exist.
Automating a SAS Enterprise Guide 3.0 project to direct results to an HTML file This technical tip will step you through automatically directing project item results to one or more HTML files using a VBScript file.
Using the MISSING Function Ever need to check for a missing value, but not sure if the variable is character or numeric? It's not a problem when using the MISSING function, explains BBU author Ron Cody.
Automated Storage Monitoring Routine for UNIX/Solaris Servers Let Bryan Beverly show you how to use SAS and a CRON scheduler to monitor file system storage.
Manipulating Data with PROC SQL This tip, provided by Kirk Paul Lafler of Software Intelligence Corporation, provides concatenation, character alignment, and phonetic and pattern matching character-string operations for manipulating data.
Adding Custom Content to the SAS Help and Documentation System "Adding custom help files is as easy as simply creating the help files (using a tool such as FrontPage or HomeSite), then referencing these files in the HELPREGISTER system option," explains BBU author Jodie Gilmore.
Concurrent Access to SAS/SHARE with an Exponential Backoff Phil Busby, a computer science major at North Carolina State University, submits the following tip to handle collision of packets: "Frequently, if one SAS process tries to access data in a table locked by another SAS process, it will come back to the user with an error, but continue executing the job. This can be trapped by checking &syserr."
Clean Up Your Messy Raw Data Sometimes you need to read data that just doesn't line up in nice columns or have predictable lengths. When you have these types of messy files, ordinary list, column or formatted input simply isn't enough. You need more tools in your bag – tools like the @'character' column pointer and the colon modifier.