Overview (GET SAS command)

GET SAS builds an active dataset from a SAS dataset or a SAS transport file. A SAS transport file is a sequential file written in SAS transport format and can be created by the SAS export engine available in SAS Release 6.06 or higher or by the EXPORT option on the COPY or XCOPY procedure in earlier versions. GET SAS reads SAS version 6-9 files.

Options

Retrieving User-Defined Value Labels. For native SAS datasets, you can specify a file on the FORMATS subcommand to retrieve user-defined value labels associated with the data being read. This file must be created by the SAS PROC FORMAT statement and can be used only for native SAS datasets. For SAS transport files, the FORMATS subcommand is ignored.

Specifying the Dataset. You can name a dataset contained in a specified SAS file, using DSET on the DATA subcommand. GET SAS reads the specified dataset from the SAS file.

Basic Specification

The basic specification is the DATA subcommand followed by the name of the SAS file to read. By default, the first SAS dataset is copied into the active dataset and any necessary data conversions are made.

Syntax Rules

  • The subcommand DATA and the SAS filename are required and must be specified first.
  • The subcommand FORMATS is optional. This subcommand is ignored for SAS transport files.
  • The subcommand ENCODING is optional.
  • GET SAS does not allow KEEP, DROP, RENAME, and MAP subcommands. To use a subset of the variables, rename them, or display the file content, you can specify the appropriate commands after the active dataset is created.

Operations

  • GET SAS reads data from the specified or default dataset contained in the SAS file named on the DATA subcommand.
  • Value labels retrieved from a SAS user-defined format are used for variables associated with that format, becoming part of the IBM® SPSS® Statistics dictionary.
  • All variables from the SAS dataset are included in the active dataset, and they are in the same order as in the SAS dataset.