Download presentation
Presentation is loading. Please wait.
Published byHelen Park Modified over 9 years ago
1
1 Chapter 2: Working with Data in a Project 2.1 Introduction to Tabular Data 2.2 Accessing Local Data 2.3 Accessing Remote Data 2.4 Importing Text Files 2.5 Editing Tables in the Data Grid (Self-Study)
2
2 Chapter 2: Working with Data in a Project 2.1 Introduction to Tabular Data 2.2 Accessing Local Data 2.3 Accessing Remote Data 2.4 Importing Text Files 2.5 Editing Tables in the Data Grid (Self-Study)
3
3 Objectives State the definition of a SAS table. State how data is stored in a SAS table.
4
4 Introduction To begin work with SAS Enterprise Guide, you 1. create a project 2. add data to the project 3. run tasks against the data. Additionally, you can 4. customize results 5. automate the process.
5
5 Microsoft Excel spreadsheets dBASE files HTML tables ODBC- compliant data OLE DB provider’s files Microsoft Access tables Fixed-width and delimited text files Common Data Formats SAS Enterprise Guide can read and use data from a variety of different formats. SAS tables
6
6 SAS Data Tables A SAS data table is a rectangular table of rows and columns. Columns (variables) Rows (observations)
7
7 SAS Data Tables All columns must have a name, type, and length. Names can be 1 to 32 characters long.
8
8 A column’s type is either character or numeric. The type plays a role in determining the length. Character values are 1 to 32,767 characters (bytes) long. Numeric values are 8 bytes of floating point storage: Numeric Currency Date (days from 01JAN1960) Time (seconds from midnight) SAS Data Tables
9
9 A format is used to control how values are displayed. Formats do not affect how values are stored. Format:MMDDYY Width:10 Stored value:15060 Format:DOLLAR Width:10 Decimal Places:0 Stored value:76806
10
10 Formats
11
11 SAS Data Table Properties
12
12 Missing Values If a data value is not present for a column in a particular row, it is considered missing. A missing character value is displayed as a blank. A missing numeric value is displayed as a period or dot....
13
13 Chapter 2: Working with Data in a Project 2.1 Introduction to Tabular Data 2.2 Accessing Local Data 2.3 Accessing Remote Data 2.4 Importing Text Files 2.5 Editing Tables in the Data Grid (Self-Study)
14
14 Objectives Add a local Excel spreadsheet to the project. View the properties of the data.
15
15 Software File Attributes The software file contains metadata. The software file does not contain metadata.
16
16 Open Options for Data Sources Other than SAS Enables SAS Enterprise Guide to read data directly Provides a detailed import process to create a new SAS table
17
17 Scenario Add an Excel spreadsheet to the project to provide a list of supplier names and addresses.
18
18 This demonstration illustrates how to add a local Excel spreadsheet to the project. Adding a Local Excel Spreadsheet to the Project
19
19 Chapter 2: Working with Data in a Project 2.1 Introduction to Tabular Data 2.2 Accessing Local Data 2.3 Accessing Remote Data 2.4 Importing Text Files 2.5 Editing Tables in the Data Grid (Self-Study)
20
20 Objectives Identify remote data sources. Access a remote server. Add remote data to a project.
21
21 Transparent Access to Remote Data Local User UNIX sas Oracle DB2 z/OS Mainframe Oracle sas Windows Server sas
22
22 Opening Data from a SAS Server The Libraries icon enables access to predefined folders containing SAS or DBMS data sources. The Files icon enables access to the directories available on the server.
23
23 The Server List window also provides an organized view of all of your files and data sources. Accessing Remote Data Server List
24
24 After you add a data source to a project, the table automatically opens in the Data Grid. Accessing Remote Data
25
25 Accessing Remote Data To prevent a table from opening automatically when added to a project, disable the following option by selecting Tools Options.
26
26 Scenario Add a remote DB2 table to the project. The table contains information on the transactions for products and stores.
27
27 This demonstration illustrates how to add a remote data table to the project. Adding a Remote Table to a Project
28
28 Chapter 2: Working with Data in a Project 2.1 Introduction to Tabular Data 2.2 Accessing Local Data 2.3 Accessing Remote Data 2.4 Importing Text Files 2.5 Editing Tables in the Data Grid (Self-Study)
29
29 Objectives Use the Import Data task to import a text file into a project as a SAS table.
30
30 Import Data Task The Import Data task can be used to convert a file into a customized SAS data table.
31
31 Import Data Task To your computer, a text file is only strings of characters. SAS Enterprise Guide requires that the data be arranged into rows and columns (observations and variables).
32
32 Import Data Task The Import Data task enables you to tell SAS Enterprise Guide the following: where each column is located in the text file which columns to read in the name of each column if the first row contains column headings the type of data in each column –character –numeric (currency, date, time) how much storage space to allocate how to display the data values
33
33 Import Data Task The Import Data task stores the data as a SAS table.
34
34 Scenario LLB Importers has a fixed-width text file named Orders. The file contains orders received this quarter from delicatessens. Create a SAS table named Orders.sas7bdat that has the following characteristics: does not contain the customer order number assigns a descriptive label to the product identification number displays the selling price and revenue as a currency
35
35 Scenario Orders.txtOrders.sas7bdat
36
36 This demonstration illustrates the functionality available when you use the Import Data task to read data. Adding Data from a Fixed-width Text File
37
37 Complete the Chapter 2 exercises starting on page 2-51. Detailed solutions are provided starting on page 2-52. Exercises
38
38 Chapter 2: Working with Data in a Project 2.1 Introduction to Tabular Data 2.2 Accessing Local Data 2.3 Accessing Remote Data 2.4 Importing Text Files 2.5 Editing Tables in the Data Grid (Self-Study)
39
39 Objectives Use the Data Grid to delete columns and rows. Use the Data Grid to modify column attributes and sort a table. Use the Expression Builder to create columns.
40
40 Data Grid When you add a table to a project, the Data Grid’s default behavior is to display the table automatically in read-only mode. Actions available in the Data Grid in read-only mode include the following: browsing SAS tables and other tables resizing row and column widths for better viewing copying rows and columns to paste into a new or existing SAS table hiding rows and columns from view holding rows and columns while scrolling
41
41 Data Grid Actions available in the Data Grid in update mode are limited to SAS tables and include all actions available in read-only mode, as well as the ability to do the following: edit data values change the names of columns apply labels and formats to columns delete rows and columns sort by multiple columns in ascending or descending order create new columns and add rows When you modify a table through the Data Grid, you change the actual data values in the table.
42
42 Data Grid: Creating a Column
43
43 Column Properties: General Tab Type a name up to 32 characters in length. Type the expression… …or use the Expression Builder. Set the column type.
44
44 Expression Builder: Creating a Column One use of the Expression Builder is to insert a new column into a data table that is computed from other columns or values.
45
45 Expression Builder: Function Tab Read a description of the function. Select the type of function. Select a specific function.
46
46 Expression Builder: Values Tab Select the column name to include it in the expression. Click on the table to view its column names.
47
47 Data Grid: Results
48
48 Scenario LLB’s UPDATEORDERS table must be updated. Delete the UnitsInStock column because the information is no longer needed. Delete order #0713 because the order was cancelled. Create a new column called Revenue that is computed as Quantity * SellPrice.
49
49 This demonstration illustrates how to switch from Read-only mode to Update mode in the Data Grid in order to modify a SAS table. Working with Tables in the Data Grid
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.