Chapter Contents

Previous

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

Entering Data


Instructions

To enter data interactively, follow this selection path:

Tasks
[arrow]
Data Management
[arrow]
Create data
[arrow]
Interactively...
The Enter Data Interactively window appears.

Enter Data Interactively Window

[IMAGE]


Entering Data in a Tabular Format

  1. Select Enter data in tabular form.... The Select a New SAS Table to Create window appears.

    Select a New Table to Create Window

    [IMAGE]

  2. In the Table field, type SALES as the name of the table that you want to create for the new data. Refer to SAS Tables for information about table naming conventions.

  3. You can store the table temporarily or permanently. For this example, store the table temporarily.

  4. Select OK. The Define a New SAS table window appears.

    Note:   Replace if existing enables you to replace the existing table with a new table of the same name. If the SALES table already exists, you get an error message stating this. You may either enter another name for the table or select Replace if existing to replace the existing table.  [cautionend]

    Define a New SAS Table Window

    [IMAGE]

  5. In the Name field, type MONTH as the name of the first new column.

  6. In the Type field, type a $ or a C to indicate that the column is a character column.

    A column can be character or numeric. If a column is defined as character, it can contain letters, numbers, special characters, and symbols, but it cannot be used in arithmetic calculations. A character column is indicated by a $ or a C in the Type field.

    If a column is defined as numeric, it can contain only numbers, decimal points, plus signs, and minus signs, and it can be used in arithmetic calculations. A numeric column is indicated by a blank or an N in the Type field.

  7. For the length, type 3. Each character uses one byte. The length indicates the number of bytes used to store each of a column's values in a SAS table. A character column can have a length from 1 to 32767.

  8. For the label, type Sales Month. The label is a description of up to 40 characters that can be printed by certain tasks instead of, or in addition to, the column name.

  9. In the second row of the Name field, type GSALES as the name of the second new column.

  10. Leave the Type field blank to indicate that the column is numeric.

  11. For the length, type 8. A numeric column can have a length of 2 to 8 bytes or 3 to 8 bytes, depending on your operating environment. If you leave this field blank, it will use a length of 8 by default.

  12. For the label, type Gross Sales.

  13. In the Format field, type dollar8.2 and press ENTER. A format is a pattern that the SAS System uses to determine how a column value should be displayed. The SAS System provides a set of standard formats and also enables you to define your own custom formats. The dollar8.2 format inserts a dollar sign before each entry, inserts commas for numbers greater than 999, and writes a decimal point and two decimal digits.

  14. Follow this selection path:

    File
    [arrow]
    Close
    A prompt appears to ask you if you want to save changes to the WORK.SALES table. Select Yes. The FSVIEW window opens to let you type new data for the columns you just defined.

    Typing Data into WORK.SALES

    [IMAGE]

    Each row in the window represents information for each sale. Each column represents a particular type of data for the sales. When you type data in a tabular format, multiple rows are shown in one window.

  15. Type data in each field, and press TAB to move from field to field if necessary. For example, type JAN for the month and 3051.20 for the first GSALES entry.

    When you have typed one row of data, press ENTER and another NEW row appears. The format you just specified also adds the dollar sign and comma to the amount of sales when the data appears. Type the rest of the data as shown here:

       FEB   2813.50
       MAR   3214.80
       APR   3471.00
       MAY   3943.70

    Use the scroll bars or the BACKWARD, FORWARD, LEFT, and RIGHT function keys to see all the columns and rows.

    Note:    If you make an error while typing the data, position the cursor on the row you want to edit and press ENTER. The row of data is highlighted to indicate that it is selected. To edit the data, press TAB to move the cursor to the data you want to change, and type the new data over the old data. To edit another row, repeat these steps.  [cautionend]

    Refer to Editing and Browsing Data for more information about editing data.

  16. When you have finished entering rows, follow this selection path to exit the FSVIEW window:

    File
    [arrow]
    Close

    Refer to Editing and Browsing Data for instructions on editing and browsing the data you just entered.


Entering Data One Row at a Time

Follow this selection path:

Tasks
[arrow]
Data Management
[arrow]
Create data
[arrow]
Interactively...

Follow steps 1 through 14 in Entering Data in a Tabular Format except, in step 1, select Enter data one record at a time... from the Enter Data Interactively window. In step 2, name the table SALES2.

After you have defined your columns, select Close from the File menu, and then select Yes to save the changes to the table. The FSEDIT window appears for the first row with the word New at the top of the window.

Entering Data into WORK.SALES2

[IMAGE]

  1. Type the following data in each field, and press TAB to move from field to field if necessary:
       JAN   4339.20

    When you have typed in one row of data, press ENTER, and the dollar sign and comma are added to the amount of sales.

  2. To add the next new row, follow this selection path:

    Edit
    [arrow]
    Add New Record
    A blank row appears with the word New in the upper right corner of the window. Continue to add new rows to add the following data:

       FEB   3482.50
       MAR   4238.80
       APR   3529.00
       MAY   3433.70

    To view other rows you have already added, select View from the menu bar and use the items as described here:

  3. When you have finished entering data, follow this selection path to exit the FSEDIT window:

    File
    [arrow]
    Close

    Refer to Editing and Browsing Data for instructions on viewing and editing the data you just entered.


Chapter Contents

Previous

Next

Top of Page

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