4 Import/Export

This section describes how to import data files into SAS and export data files from SAS that are in different file formats. SAS data tables have the file extension .sas7bdat and can be read in and saved out as permanent files easily using the LIBREF.Table-Name combination. Files with other extensions like Excel (XLSX) and text (TXT) must be imported and exported differently since they are formatted differently than SAS data tables. The options specified in your import and export code tell SAS how the data in the files is formatted and how SAS needs to transform the data to get it into the SAS format when reading it in or how to export it into a different file format when saving it out as a permanent file.

4.1 Importing Data

Get The Simple Guide to SAS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.