Chapter Contents

Previous

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

Editing Data One Row at a Time

When you edit data one row at a time, only one row is shown per window.

  1. To edit data one row at a time, follow this selection path:

    Tasks
    [arrow]
    Data Management
    [arrow]
    Edit/Browse
    [arrow]
    Edit Data
    The Edit Data window appears.

  2. Select Single row. The Edit Data One Record at a Time window appears.

  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. The first row of the HOUSES table appears.

    First Row of HOUSES Table

    [IMAGE]

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 pull-down menu, you can:

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.


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.

  1. Follow this selection path:

    Edit
    [arrow]
    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

    [IMAGE]

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

  3. 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, you can duplicate a row and type in the data for the columns that are different.

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

  2. Follow this selection path:

    Edit
    [arrow]
    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

    [IMAGE]

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


Deleting Data

  1. Display the row you want to delete by following this selection path:

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

  2. Follow this selection path:

    Edit
    [arrow]
    Delete Record
    The data in the row's fields is deleted.

  3. Follow this selection path to view the previous row:

    View
    [arrow]
    Previous Observation
    Repeat step 2 to delete this row.


Canceling Changes

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.

  1. For this example, display row 3 by using the items on the View menu or the function keys.

  2. Type XXXXX over the existing style.

  3. Follow this selection path:

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

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

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

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

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

  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 can also save data at any time.


Exiting the FSEDIT Window

When you have finished editing the data, exit by following this selection path:

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