6   Using PROC SQL with Longitudinal Data


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


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 ...

Get Longitudinal Data and SAS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.