Data Step Processing [5-9]


Program Data Vector (PDV)

The Program Data Vector (PDV) is a very important concept for SAS base programming.

It is the place where SAS builds the data set.

Unlike the input buffer, the PDV contains variables similar to the image below:

The PDV is created based on the INPUT statement.

In our example, the INPUT statement has two variables: Name and Age.


Input Name $ Age;

The two variables are created in the PDV:

The PDV also contains two automatic variables: _n_ and _error_.

The two automatic variables will be explained in later sections.

The official definition of the program data vector is as follow:

Program Data Vector (PDV) is a logical area in memory where SAS builds a data set, one observation at a time. When a program executes, SAS reads data values from the input buffer or creates them by executing SAS language statements. The data values are assigned to the appropriate variables in the program data vector. From here, SAS writes the values to a SAS data set as a single observation.