Chapter Contents |
Previous |
Next |
IMPORT |
Category: | SAS Table |
Syntax | |
Details | |
The IMPORT Window | |
IMPORT Window Command Menu | |
The DEFINE Window | |
Examples |
Syntax |
name=IMPORT(table-name,file<,'DEFINE'>); |
Type: Character
Type: Character
Type: Character
'DEFINE'
Type: Character
Details |
The IMPORT function returns the name of the last SAS table that it created from an external data file. This function enables users to easily import raw data from an external file into a SAS table.
Two auxiliary windows are associated with IMPORT: the IMPORT window and the DEFINE window.
The IMPORT Window |
The IMPORT window, which defines the columns for the SAS table, is the primary window for the IMPORT function. The first two lines of the external file are displayed below a ruler in order to help the application user identify the variables for the columns.
If numbers for start and end columns are not supplied, then list input is used, and items in the file must be separated by at least one blank. Users can use the following fields in the IMPORT window to specify information about the table columns:
IMPORT Window Command Menu |
The File menu enables you to perform save operations, to import data with the Import Wizard, to export data using the Export Wizard, to perform print operations, to send mail, and to close the window.
The Edit menu enables you to copy marked text, to select or deselect marked text, to set the horizontal and vertical scroll amounts, to perform find operations, and to set the keyfield (the field to search with the next Find command).
The View menu enables you to scroll right and left, to specify the sort order for fields in the window, to display the first record in hexadecimal representation, and to open other SAS windows.
The Tools menu enables you to specify conditions for querying values in the file, to open a Viewtable window, and to run a session of graphics editors, the Report Editor or Text Editor. You can also set a variety of options.
The Data menu enables you to create a SAS table from contents of the external file, to test read the file, to define fields with the Define window, to specify a different external file for input, to specify a new name for the SAS table to create, to display the length of the longest record that has been read, to view the external file, and to edit or browse the data set that was created from the external file.
The DEFINE Window |
The DEFINE window is displayed when you use the DEFINE option with the IMPORT function or when you select
Data | Define fields |
In order to use the DEFINE window, you must align the data values in columns in the data records.
When you issue the END command to exit from this window, the fields are given default column names and types (numeric or character). The IMPORT window then opens so that you can change the column names and optionally add formats and informats.
Examples |
name=import('mylib.new','extern');
name=import('mylib.new',"'sample1.data'");
Note: The form of the physical filename depends
on the host operating system.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.