Editing and Browsing Data |
To edit or browse data, selectTasks Data management Edit/Browse Edit DataThe Edit Data window appears.
Note: For this example you will edit the data, but if you wanted only to browse the data, you would select Browse Data instead of Edit Data.
Edit Data Window
Select . The Edit Data in Tabular Format window appears.
Edit Data in Tabular Format Window
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 at the bottom of the Edit Data in Tabular Form window. The data from the SASUSER.HOUSES table appears in the FSVIEW window. Disregard any notes in the message area about a formula.
HOUSES Table Data
When you edit data in a tabular format, multiple rows are shown in one window.
To see the rest of the columns to the right of the window, use the scroll bars or the RIGHT and LEFT function keys. You can also use your FORWARD and BACKWARD function keys to move to the next and previous windows of rows if you have more rows than will fit in one window.
Setting the Update Mode |
You can edit data in tabular format in one of two update modes: record-locking or member-locking. If you edit data in record-locking mode, then you must first select a row before you can edit it. This method prevents you from accidentally editing the wrong row. If you edit data in member-locking mode, then you can edit any row in the window without selecting it first. The default update mode is record-locking.
To set the update mode, select Edit from the menu bar, and then select Update or Set modification mode, depending on your operating environment. The Update or Set modification mode dialog box appears.
Update Window
Select the update mode you want to use: RECORD (to edit one row at a time only after you have selected it) or MEMBER (to edit any row on the window). The Update window remains displayed.
For this example, select RECORD if it is not already selected, and then select . The FSVIEW window reappears.
Editing by Row |
Use the following process to make changes to existing data. When record-locking is turned on, you must first select a row before you can edit it.
If you have not already done so, turn record-locking on by following the directions in the previous section.
To edit a row, select the row you want to edit. The row of data is highlighted to indicate that it is selected.
To edit the data, press TAB or use the right and left arrow keys to move the cursor to the data you want to change, and then type the new data over the old data. To edit another row, repeat these steps.
For this example, position the cursor on the CONDO style of row 15 (or the last row) and type SPLIT over CONDO (or over the existing style).
Editing by Member |
Use this process to make changes to existing data. When member-locking is on, you can edit any row in the window without first selecting the row. To turn member-locking on, follow the directions in Setting the Update Mode, except select MEMBER in the Update window.
To edit a row, use the arrow keys to position the cursor on the data you want to change and type the new data over the old data.
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. Follow these same instructions to add data whether record-locking or member-locking is on:
To add data, selectEdit AutoaddA NEW row appears at the bottom of the window.
Adding a New Row
When the AUTOADD feature is turned on, a new row is automatically displayed at the bottom of the table. This row is not added to the table until you enter values in it. After you enter values and press ENTER, the row is added to the table and another new row is displayed.
Type data in each column, and press TAB to move from column to column.
Type the data where the cursor is placed within each column after you press TAB. After you type all the data for each column in the row, press ENTER. The numeric data align to the right of each column. The dollar sign and decimal are also added to the price after you press ENTER.
After you type the number of baths, you can use the scroll bars or the RIGHT and LEFT function keys to display additional columns.
For this example, type the data as follows:
STYLE | |
SQFEET | |
BEDROOMS | |
BATHS | |
STREET | |
PRICE |
When you have typed one row of data and pressed ENTER, another NEW row appears at the bottom of the window. This feature is a result of having Autoadd turned on.
New Row
When you have finished entering new rows, selectEdit Autoaddto turn off the Autoadd feature.
Duplicating Data |
If some rows are similar, then you can duplicate a row and type in the data for the columns that are different. Follow the same instructions for duplicating rows whether record-locking or member-locking is on.
To duplicate a row, selectEdit DuplicateThe Duplicate window appears.
Duplicate Window
Type the number of copies you want to make and the number of the row you want to duplicate.
For this example, make two copies of row number 16 (or the last row), and then select . The duplicated rows appear at the bottom of the list of rows.
Duplicated Rows
Edit the duplicated rows as necessary with the new data. For this example, select row number 18 and change the style to SPLIT .
Deleting by Row |
If record-locking is on, then you must first select a row before you can delete it. You can turn record-locking on by following the directions in Setting the Update Mode.
To delete a row, select the row that you want to delete. The row is highlighted to indicate that it is selected. For this example, select row 18 (or the last row).
SelectEdit DeleteThe Delete window appears.
Delete Window
Type the number of the row you want to delete (the row that is highlighted). For this example, type 18 , and then select . The highlighted row is deleted and the FSVIEW window appears.
Deleting by Member |
If member-locking is on, then you can delete any row without selecting it. To turn member-locking on, follow the directions in Setting the Update Mode, except select MEMBER in the Update window.
To delete a row, selectEdit DeleteThe Delete window appears.
Type the row(s) you want to delete. Select . If you want to delete more than one row, then type the row numbers separated by spaces. For example, type 1 3 5 to delete rows 1, 3, and 5. If you want to delete a range of rows, then type the beginning and ending row numbers separated by a hyphen. For example, type 12-15 to delete rows 12 through 15.
Select . The rows are deleted, and the FSVIEW window appears.
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 bathrooms), 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.
Where Window
To look at only the houses that are larger than 1,500 square feet, type the clause sqfeet>1500 , and then select . The HOUSES data in the window includes only houses with more than 1,500 square feet. The word Where appears at the top of the window to indicate that a WHERE clause is in effect.
Houses with More Than 1,500 Square Feet
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 . The HOUSES data in the window includes only houses with three bathrooms and that are larger than 1,500 square feet.
Houses with More Than 1,500 Square Feet and Three Baths
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, they must be enclosed in double or single quotes and must be in the correct case. For example, if you only want to see the ranch-style houses, you would type style='RANCH' . The word RANCH needs to be in all capital letters because all of 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 also can 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 FSVIEW window reappears. Changes you make to the table are saved automatically after the number of row modifications you specified.
Exiting the FSVIEW Window |
When you have finished editing the data, exit as follows:
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.