O'Reilly logo

Longitudinal Data and SAS by EdD Ron Cody

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

6   Using PROC SQL with Longitudinal Data

Introduction

Creating a Demonstration Data Set

A Simple SQL Query

Using PROC SQL to Count Observations within a BY Group

Demonstrating a HAVING Clause

Using PROC SQL to Create a Macro Variable

Using a Summary Function to Compute Group Means

Introduction

A SAS procedure called PROC SQL (which stands for Structured Query Language and is pronounced “sea quell” or spelled out as S-Q-L ) provides you with an alternative or addition to DATA step programming. There are several applications of SQL to longitudinal data where one SQL query can replace several DATA steps.  SQL is especially useful when you want to combine summary information (such as a count of the number of observations for each subject) with the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required