Previous Page | Next Page

Processing VSAM Data Sets in SAS Programs

Operations on VSAM Data Sets in SAS Programs

SAS programs handle VSAM data sets the same as any external data set. The following are examples of operations that SAS can perform on external data sets, which are data sets that are not created by SAS:

Processing VSAM Data Sets in SAS Programs illustrates a typical SAS DATA step processing a VSAM data set. A VSAM external data set is shown as input to a SAS DATA step. Only the INFILE statement with some of the most common special SAS options and the FILE statement are shown. Notice that both the INFILE and FILE statements specify the VSAM option and the fileref that refers to the VSAM data set. The RBA=, KEY=, and RRN= direct access variables are shown as INFILE statement options that depend on whether the VSAM data set is an ESDS, a KSDS, or an RRDS. (You do not need to specify a direct access option to process the data set sequentially.) The FEEDBACK= variable is specified in the INFILE statement. Remember that you would need both an INPUT and a PUT statement to read and update the VSAM data set.

Processing VSAM Data Sets in SAS Programs

[Processing VSAM Data Sets in SAS Programs]

You can perform five general types of operations on VSAM data sets in SAS programs:

When you perform these operations, you can use certain types of access with each data set type. See Supported VSAM Operations and Access Types for an outline of this information. Note that VSAM provides both sequential and some form of direct access for each data set type.

Supported VSAM Operations and Access Types
Operation Access Type ESDS KSDS RRDS
Read Sequential: Yes Yes Yes
Direct access by:


Key No Yes No
Generic key No Yes No
RBA Yes Yes No
RRN No No Yes
Skip sequential: No Yes Yes
Update Sequential: Yes Yes Yes
Direct access by:
Key No Yes No
RBA Yes Yes No
RRN No No Yes
Add/Load Sequential: Yes Yes Yes
Direct access by:
Key No Yes No
RBA No No No
RRN No No Yes
Erase Sequential: No Yes Yes
Direct access by:
Key No Yes No
RBA No Yes No
RRN No No Yes

Previous Page | Next Page | Top of Page