Chapter Contents

Previous

Next
Getting Started with the SAS System Using SAS/ASSIST Software

Editing Data in a Tabular Format

  1. To edit or browse data, follow this selection path:

    Tasks
    [arrow]
    Data management
    [arrow]
    Edit/Browse
    [arrow]
    Edit Data...
    The 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... as the last step of the selection path.  [cautionend]

    Edit Data Window

    [IMAGE]

  2. Select Tabular format. The Edit Data in Tabular Format window appears.

    Edit Data in Tabular Format Window

    [IMAGE]

  3. 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.

  4. Select Run 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

    [IMAGE]

    When you edit data in a tabular format, multiple rows are shown in one window.

  5. 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, 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, you can edit any row in the window without selecting it first. The default update mode is record-locking.

  1. 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 window appears.

    Update Window

    [IMAGE]

  2. 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 OK. 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.

  1. If you have not already done so, turn record-locking on by following the directions in the previous section.

  2. To edit a row, select the row you want to edit. The row of data is highlighted to indicate that it is selected.

    For this example, select row 15 (or the last row).

  3. 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 selecting it. 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:

  1. To add data, follow this selection path:

    Edit
    [arrow]
    Autoadd
    A NEW row appears at the bottom of the window.

    Adding a New Row

    [IMAGE]

    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.

  2. 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 CONDO
    SQFEET 1420
    BEDROOMS 3
    BATHS 2
    STREET Oak Street
    PRICE 85000

    When you have typed one row of data and pressed ENTER, another NEW row appears at the bottom of the window. This is a result of the AUTOADD feature.

    New Row

    [IMAGE]

  3. When you have finished entering new rows, follow this selection path:

    Edit
    [arrow]
    Autoadd
    The Autoadd feature is turned off.


Duplicating Data

If some rows are similar, 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.

  1. To duplicate a row, follow this selection path:

    Edit
    [arrow]
    Duplicate...
    The Duplicate window appears.

    Duplicate Window

    [IMAGE]

  2. 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 OK. The duplicated rows appear at the bottom of the list of rows.

    Duplicated Rows

    [IMAGE]

  3. 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, 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.

  1. To delete a row, select the row you want to delete. The row is highlighted to indicate that it is selected. For this example, select row 18 (or the last row).

  2. Follow this selection path:

    Edit
    [arrow]
    Delete...
    The Delete... window appears.

    Delete Window

    [IMAGE]

  3. Type the number of the row you want to delete (the row that is highlighted). For this example, type 18, and then select OK. The highlighted row is deleted and the FSVIEW window appears.

  4. Also delete rows 16 and 17.


Deleting by Member

If member-locking is on, 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.

  1. To delete a row, follow this selection path:

    Edit
    [arrow]
    Delete
    The Delete... window appears.

  2. Type the row(s) you want to delete. Select OK. If you want to delete more than one row, 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, type the beginning and ending row numbers separated by a hyphen. For example, type 12-15 to delete rows 12 through 15.

    Select OK. The rows are deleted, and the FSVIEW window appears.


Creating a Subset of Your Data

If you only want to see 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.

  1. To create a subset of the data, follow this selection path:

    Search
    [arrow]
    Where...
    The Where window appears.

    Where Window

    [IMAGE]

  2. To look at only the houses that have greater than 1500 square feet, type the clause sqfeet>1500, and then select OK. The HOUSES data in the window show only houses with more than 1500 square feet. The word Where appears at the top of the window to indicate that a WHERE clause is in effect.

    Houses with > 1500 Square Feet

    [IMAGE]

  3. 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
    [arrow]
    Where also...
    The Where also window appears. Type baths=3 to select only the houses with three bathrooms.

  4. Select OK. The HOUSES data in the window show only houses with three bathrooms that are more than 1500 square feet.

    Houses with > 1500 Square Feet and Three Baths

    [IMAGE]

    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, 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.

  5. To undo the last WHERE clause (the restriction of three bathrooms in this example), follow this selection path:

    Search
    [arrow]
    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.


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.


Exiting the FSVIEW Window

When you have finished editing the data, exit as follows:

  1. Follow this selection path:

    File
    [arrow]
    Close
    The Edit Data in Tabular Format window reappears.

  2. Select Goback twice to return to the WorkPlace menu.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.