Bringing in Data

 < Day Day Up > 



Opening Local Files

The Analyst Application supports many different file formats, including SAS data sets, Excel spreadsheets, Lotus spreadsheets, SPSS portable files, and delimited files. You can open data files from your operating system's directories or folders and bring them into the data table by selecting File Open...

click to expand
Figure 2.2: Open Dialog

In the Open dialog, select a file and click Open to bring the contents of the file into the data table. External files (files that were not created in SAS) opened into Analyst are converted into SAS data sets. The source files are not altered.

Opening SAS Files

You can bring SAS data sets or data views into the Analyst data table by selecting File Open By SAS Name...

click to expand
Figure 2.3: Select A Member Dialog

Select a SAS library from the list of Libraries and select a member. Click OK to bring the contents of the SAS data set or data view into the data table.

Using the Query Window

You can use the Query window to reduce the number of variables that you load into the data table. You can also use the Query window to bring more than one data set into the data table, as well as write SQL queries to filter the data.

Opening a New Query

You can use the Query window to bring selected columns of data from one or more SAS data sets into the data table. The Query window opens a view of the data set that cannot be edited. You can, however, save the view as a SAS data set that you can edit. To save the view as a SAS data set, select File Save As By SAS Name...

click to expand
Figure 2.4: SQL QUERY TABLES Window

Select File Open With New Query...to open the SQL QUERY TABLES window. Select one or more tables to use in your query and click on the right arrow.

Click OK to display the SQL QUERY COLUMNS window. Select the columns that you want to include in the query and click on the right arrow.

click to expand
Figure 2.5: SQL QUERY COLUMNS Window

Select File Close to exit the Query window and open the data view into the Analyst data table.

The query is added as a node to your project tree, and the selected columns are brought into the data table. The name of the query node is generated by Analyst in the form QUERY nnnn.

Caution 

If you select the Analyst window while in the Query window, the resulting query is not returned to Analyst.

Saving and Opening an Existing Query

Once you have used the Query window to create views of SAS data, you can bring these views into Analyst.

To create a query to use later, prepare your query in the Query window, and select File Save Query Save as QUERY to Include later in the SQL QUERY COLUMNS window. Select the SAS library, catalog, and library member name.

To open a saved query in Analyst, select File Open With Existing Query...The Open with Existing Query window searches for saved queries in all available SAS libraries.

click to expand
Figure 2.6: Open with Existing Query Window

You can also use the Query window to apply an SQL query to your data. Refer to the Query window documentation for more information.



 < Day Day Up > 



SAS Institute - The Analyst Application
The Analyst Application, Second Edition
ISBN: 158025991X
EAN: 2147483647
Year: 2003
Pages: 116

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net