PANEL Procedure

FLATDATA Statement

  • FLATDATA options </OUT=SAS-data-set>;

The FLATDATA statement enables you to use PROC PANEL when you have data in flat (or wide) format, where all measurements for a particular cross section are contained within one observation. See Example 25.6 for a demonstration. If you have flat data, you should issue the FLATDATA statement first in PROC PANEL, before you reference any variables that you create using this statement.

You must specify the following options:

BASE=(basename basename … basename)

specifies the variables to be transformed into a proper PROC PANEL format. All variables to be transformed must be named according to the convention basename_timeperiod. You supply only the base names, and the procedure extracts the appropriate variables to transform. If some year’s data are missing for a variable, then PROC PANEL detects this and fills in missing values.

INDID=variable

names the variable in the input data set that uniquely identifies each individual. The variable can be a character or numeric variable.

TSNAME=name

specifies a name for the generated time identifier. The name must satisfy the requirements for the name of a SAS variable. The name can be quoted, but it must not be the name of a variable in the input data set.

You can also specify the following option:

KEEP=(variable variable … variable)

specifies the variables to be copied without any transformation. These variables remain constant with respect to time when the data are converted to PROC PANEL format.

You can also specify the following option after a slash (/):

OUT=SAS-data-set

saves the converted flat data set to a data set in PROC PANEL format.

Last updated: June 19, 2025