Getting Started with the SAS System Using SAS/ASSIST Software |
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 Data |
The Edit Data window appears.
- Select
Single row. The Edit Data One Record at a Time window appears.
- If the active table is SASUSER.HOUSES,
continue to the next step. Otherwise, select Table, and then select the SASUSER.HOUSES table. For more information on selecting tables, see
Selecting a Table.
- Select Run. 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.
To move to different rows,
select View from the menu bar. From the View pull-down 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 OK. The row you requested
appears.
If you have too many columns to 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 pull-down 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.
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
.
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.
- Follow this selection path:
Edit |
|
Add New Record |
A 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 |
SPLIT |
SQFEET |
2200 |
BEDROOMS |
4 |
BATHS |
3 |
STREET |
Maple Street |
PRICE |
120000 |
- 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.
If some rows are similar, 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.
For this example, display row number 1.
- Follow this selection path:
Edit |
|
Duplicate
Record |
The 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.
For this example, change the style to
CONDO
.
- Display the row you want to delete by following this selection
path:
View |
|
Observation Number... |
For this example, display the last row by going to a row that is numbered higher than your last row, for
example, 99.
- Follow this selection path:
Edit |
|
Delete Record |
The data in the row's fields is
deleted.
- Follow this selection path to view the previous row:
View |
|
Previous Observation |
Repeat
step 2 to delete this row.
If you make any
changes to a row, 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.
- Type
XXXXX
over the existing style.
- Follow this selection path:
Edit |
|
Cancel Current Changes |
The 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 only want to see all the houses for sale that are greater
than 1500 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, follow this selection
path:
Search |
|
Where... |
The Where window appears.
- To look at only the
houses that have greater than 1500 square feet, type the clause
sqfeet>1500
.
Select OK. As you move from row to row, only houses with more than 1500 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 1500 square feet that have three
bathrooms, follow this selection path:
Search |
|
Where also... |
The Where Also window appears. Type
baths=3
to select only the houses with three bathrooms.
- Select OK. As you move from row to row, only houses with three bathrooms that are
more than 1500 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 < |
less than |
GT or > |
greater than |
EQ or = |
equal to |
LE or <= |
less than or equal to |
GE or >= |
greater than or equal to |
NE or <> |
not equal to |
IN |
equal to one in a list |
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), follow this selection path:
Search |
|
Undo last where |
The last WHERE clause that selected
the houses with three bathrooms is removed, and all the houses with more than 1500 square feet appear. Continue to select Undo last where to undo each previous WHERE
clause.
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, follow this selection
path:
File |
|
Save |
Any additions or changes to the data are saved.
- To change the autosave feature,
follow this selection path:
Edit |
|
Autosave... |
The Autosave window appears. Type the number of row modifications
after which you want to save your changes and additions. Select OK; 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 Goback twice to return to the WorkPlace menu.
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.