SAS Institute. The Power to Know

Export ArcMap data to a SAS data set

You can either export all features from the layer or export selected features.

To export SAS data from ArcMap, see Add SAS data to ArcMap.

Export All Features from the Layer

To export all of the features from a layer:

  1. Right-click the layer that you want to export, and then select Data Export to a SAS data set

  2. Select All features
    Note: If the layer contains a query, then the query is not used when you export the layer attributes.

  3. Specify the SAS server to which the data is exported.
    Note: The list of available servers is generated from the SAS OLE database connections defined in ArcCatalog. The default server is the first one in the list. If you select a different SAS server, then it becomes the default server for subsequent exports. If a connection fails, then the next one in the list is tried until a connection is successful.
    If, and only if, the list of available servers is empty (because no SAS OLE database connection has been defined in ArcCatalog), then the SAS Bridge for ESRI attempts to use a local installation of SAS (which it names Local SAS).
    However, if a local installation of SAS is not available, then you must use ArcCatalog to add an OLE database connection.

  4. Specify the path and filename for the SAS data set that you want to create. If you are exporting to a local SAS server, then you can browse to the output location by clicking the File Open button .
    By default, the data is written to the SASUSER path to a data set named Export_Output.sas7bdat. You can direct the output to any directory to which you have write access, and you can change the name from Export_Output to any valid SAS data set name. On subsequent exports, the name defaults to the last name that you entered.

  5. Choose whether to export geometry data. If you select Export Geometry Data, then two additional SAS data sets are created:

    • A data set with the suffix _xy contains the x and y coordinates that define the feature.
    • A data set with the suffix _xy_meta contains spatial reference information.

    Note: The types of geometry that can be exported to a SAS data set are: Point, Polyline, and Polygon. If the geometry is not one of these types, then the geometry export fails, and an error message appears in the export dialog box.

    Note: If the attribute data set already exists, and if you choose Replace or Append, then that same action is performed on an existing geometry data set. If you choose Append and the _xy data set does not exist, then the export will fail. You can choose Replace instead to create the geometry data sets.

    Note: When you append to an existing geometry data set, the _xy_meta file is replaced rather than appended.
  6. Click OK. Your SAS data sets are created in the location that you specified. In addition, if you selected the Save XML Data option, then data is written in XML format to your Windows TEMP directory. For more information about the XML files, see Configure Bridge for ESRI Options.

Export Selected Features

To export selected features from an ArcMap layer to a SAS data set:

  1. Right-click the layer that you want to export, select Open Attribute Table.

  2. Select the rows that you want to export by using one of the following methods:
    • Click in the left-most column of the table to select individual rows.
      Use Ctrl + Click to select multiple rows, or drag your cursor across the left-most column of the rows to be selected.
    • Select Table Options Select by Attributes to select rows with an SQL query.

  3. Select Table Options Export to a SAS data set.

  4. Select Selected features.
    Note: You must select rows from the layer's data set for Selected features to be available.
    Note: If the layer contains a query, then the query is not used when you export the layer attributes.

  5. Specify the SAS server to which the data is exported.
    Note: The list of available servers is generated from the SAS OLE database connections defined in ArcCatalog. The default server is the first one in the list. If you select a different SAS server, then it becomes the default server for subsequent exports. If a connection fails, then the next one in the list is tried until a connection is successful.
    If, and only if, the list of available servers is empty (because no SAS OLE database connection has been defined in ArcCatalog), then the SAS Bridge for ESRI attempts to use a local installation of SAS (which it names Local SAS).
    However, if a local installation of SAS is not available, then you must use ArcCatalog to add an OLE database connection.

  6. Specify the path and filename for the SAS data set that you want to create. If you are exporting to a local SAS server, then you can browse to the output location by clicking the File Open button .
    By default, the data is written to the SASUSER path to a data set named Export_Output.sas7bdat. You can direct the output to any directory to which you have write access, and you can change the name from Export_Output to any valid SAS data set name. On subsequent exports, the name defaults to the last name that you entered.

  7. Click OK. Your SAS data sets are created in the location that you specified. In addition, if you selected the Save XML Data option, then data is written in XML format to your Windows TEMP directory. For more information about the XML files, see Configure Bridge for ESRI Options.