Editing and Browsing Data |
When you edit data one row at a time, only one row is shown per window.
To edit data one row at a time, follow this selection path:Tasks Data Management Edit/Browse Edit DataThe Edit Data window appears.
If the active table is SASUSER.HOUSES, then continue to the next step. Otherwise, select , and then select the SASUSER.HOUSES table. For more information on selecting tables, see Selecting a Table.
Select . The first row of the HOUSES table appears.
First Row of HOUSES Table
The row number is located in the top of the window. Each window presents one row in the HOUSES table. Each window is called a record or a row. Each field in the window represents a column.
Moving Around |
To move to different rows, select View from the menu bar. From the View menu, you can
select Next Observation to move forward to the next row ("observation" is another word for "row")
select Previous Observation to move backward to the previous row
select Observation Number to move to a specific row. The Observation number window appears. Type the number of the row you want to display, and then select . The row that you requested appears.
If there are more columns than will fit on one screen, each row has as many screens as necessary to display all the columns for the row. Use Next screen and Previous screen from the View menu to move from screen to screen within a row. The HOUSES table has only one screen per row.
You can also use the FORWARD, BACKWARD, RIGHT, and LEFT function keys to move from row to row and screen to screen.
Editing Data |
To edit a row, position the cursor on the data you want to change, and type the new data over the old data.
For this example, display row 15 using the items from the View menu or the function keys. Change the style to CONDO .
Adding Data |
Use this process when you want to add new information to the table. For example, you might want to add new houses for sale to the HOUSES table.
SelectEdit Add New RecordA blank row appears as the last row, and the word New appears at the top of the window.
Adding a New Record
Type data in each field, and press TAB to move from field to field.
Type the data where the cursor is placed within each field after you press TAB. After you have typed all the data for the row, press ENTER. The numeric data aligns to the right of each field. The dollar sign and decimal are also added to the price after you press ENTER.
For this example, type the data as follows, and then press ENTER:
STYLE | |
SQFEET | |
BEDROOMS | |
BATHS | |
STREET | |
PRICE |
When you have typed one row of data, you can continue adding rows using the instructions in steps 1 and 2.
After you move to another row, the new row is assigned a row number.
Duplicating Data |
If some rows are similar, then you can duplicate a row and type in the data for the columns that are different.
To duplicate data, display the row you want to duplicate by using the items from the View menu or the function keys.
SelectEdit Duplicate RecordThe row displayed (row 1) is duplicated and added to the end of the rows in the table. The word New appears in the top of the window to indicate that this is a new (duplicated) row.
Duplicated Record
Make any changes to the row as necessary. After you move to another row, the new row is assigned a row number.
Deleting Data |
Display the row you want to delete by following this selection path:View Observation NumberFor this example, display the last row by entering a number that is higher than that of the last row, for example, 99.
SelectEdit Delete RecordThe data in the row's fields is deleted.
Follow this selection path to view the previous row:View Previous ObservationRepeat step 2 to delete this row.
Canceling Changes |
If you make any changes to a row, then you can cancel the changes as long as you have not moved to another row, saved the row, or ended the editing session.
For this example, display row 3 by using the items on the View menu or the function keys.
SelectEdit Cancel Current ChangesThe style is restored to its previous value.
Creating a Subset of Your Data |
If you want to see only a part of the data (for example, if you want to see only the houses for sale that are larger than 1,500 square feet with three baths), you can create a subset of the data with a WHERE clause. The WHERE clause selects a subset of rows by comparing the values of the columns to the value you specify in the clause.
To create a subset of the data, selectSearch WhereThe Where window appears.
To look at only the houses that have more than 1,500 square feet, type the clause sqfeet>1500 .
Select . As you move from row to row, only houses with more than 1,500 square feet appear. The word Where appears at the top of the window to indicate a WHERE clause is in effect.
To create a further subset of the data so that you see only the houses with more than 1,500 square feet that have three bathrooms, selectSearch Where alsoThe Where Also window appears. Type baths=3 to select only the houses with three bathrooms.
Select . As you move from row to row, only houses with three bathrooms that have more than 1,500 square feet appear.
The following is a list of some of the comparison operators that you can use in a WHERE clause (arithmetic, logical, and other operators are also available):
LT or < | |
GT or > | |
EQ or = | |
LE or <= | |
GE or >= | |
NE or <> | |
IN |
If you use character strings in the clauses, make sure they are enclosed in double or single quotes and are in the correct case. For example, if you wanted to see only the ranch-style houses, you would type style='RANCH' . The word RANCH needs to be in all capital letters because all the styles in the HOUSES table are in uppercase.
To undo the last WHERE clause (the restriction of three bathrooms in this example), selectSearch Undo last whereThe last WHERE clause that selected the houses with three bathrooms is removed, and all the houses with more than 1,500 square feet appear. Continue to select Undo last where to undo each previous WHERE clause.
Saving |
Periodically, you may want to save any changes and additions you have made to the data so that they are stored permanently. The autosave feature saves the changes for you after 25 row modifications. You can change the autosave feature so that it saves data after any number of row modifications you specify. You can also save data at any time.
To save changes, selectFile SaveAny additions or changes to the data are saved.
To change the autosave feature, selectEdit AutosaveThe Autosave window appears. Type the number of row modifications after which you want to save your changes and additions. Select ; the FSEDIT window reappears. Changes you make to the table are saved automatically after the number of row modifications you specified.
Exiting the FSEDIT Window |
When you have finished editing the data, exit by following this selection path:File Close Select twice to return to the WorkPlace menu.
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.