White Papers

LAG - The Very Powerful and Easily Misused SAS Function

Overview There are times when SAS programmers need to relate the value of a variable in the current observation to the value of the same or another variable in the previous observation. The LAG function is a very useful tool for this purpose. Unfortunately, it is frequently misused and produces unexpected results. This is because it often appears that the LAG function returns the value of the variable from the previous observation, which is true if it is called in non-conditional code. However, when it is executed conditionally, the LAG function only retrieves values from observations for which the condition is satisfied. This paper discusses how the LAG function should be used in different situations to avoid unexpected results.

Download White Paper

By downloading you agree to our Terms and Conditions. These include information regarding use of your personal data.

Publisher
SAS Institute
File Format
PDF
Date Published
May 30, 2009
Format
White Papers
Topics
Programming Languages

Similiar White Papers

Build Strong, Flexible J2EE apps With a WebSphere Cluster Environment

Build Strong, Flexible J2EE apps With a WebSphere Cluster Environment

When building a strong, extensible, and flexible J2EE application, one needs to consider several factors. One important

Publisher: IBM  |  Tags: application server, management, server

TechNet Webcast: Managing Hyper-V Virtual Machines With WMI and Windows PowerShell (Level 300)

TechNet Webcast: Managing Hyper-V Virtual Machines With WMI and Windows PowerShell (Level 300)

Before the beta release of Microsoft System Center Virtual Machine Manager 2008, there was only one option for automatin

Publisher: Microsoft  |  Tags: beta, management, windows server, windows server 2008

Building a Hybrid Data Warehouse Model

Building a Hybrid Data Warehouse Model

This paper discusses the hybrid design and provides a fully functional reference implementation. The system runs on Orac

Publisher: Oracle  |  Tags: data, database, warehouse

Taking Advantage of Microsoft Enterprise Library 4.0 for Visual Studio 2008

Taking Advantage of Microsoft Enterprise Library 4.0 for Visual Studio 2008

Microsoft Enterprise Library is a collection of reusable software components (application blocks) designed to assist sof

Publisher: Microsoft  |  Tags: developers, software

Why and How to Build a Continuous Integration Environment for the .NET Platform

Why and How to Build a Continuous Integration Environment for the .NET Platform

This paper is a learning tool and also a detailed manual to reference for executives, managers and developers on 'Why an

Publisher: Enterprise Solution Providers  |  Tags: developers

SAS Institute White Papers

A Clever Demonstration of the SAS SUBSTR Function

A Clever Demonstration of the SAS SUBSTR Function

The SAS SUBSTR function differs from the substring function in other programming languages as it can be used on either s

Publisher: SAS Institute

Understanding Your Customer: Segmentation Techniques for Gaining Customer Insight and Predicting Risk in the Telecom Industry

Understanding Your Customer: Segmentation Techniques for Gaining Customer Insight and Predicting Risk in the Telecom Industry

The explosion of customer data in the last twenty years has increased the need for data mining aimed at Customer Relatio

Publisher: SAS Institute  |  Tags: crm, customer service, data, data mining

An Animated Guide: Proc Transpose

An Animated Guide: Proc Transpose

If one can think about a SAS data set as being made up of columns and rows, one can say Proc Transpose "Flips" the colum

Publisher: SAS Institute  |  Tags: data

Cool New Features in SAS Enterprise Miner 5.3

Cool New Features in SAS Enterprise Miner 5.3

SAS released Enterprise Miner 5.3 in late 2007 with a veritable plethora of cool new features for data miners everywhere

Publisher: SAS Institute  |  Tags: data, software

An Introduction to SAS Character Functions

An Introduction to SAS Character Functions

SAS software is especially rich in its assortment of functions that deal with character data. This class of functions is

Publisher: SAS Institute  |  Tags: data, software