Chapter Contents

Previous

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

Sorting Data


Instructions

  1. To sort your data, follow this selection path:

    Tasks
    [arrow]
    Data Management
    [arrow]
    Sort...
    The Sort a Table window appears.

    Sort a Table Window

    [IMAGE]

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

  3. If other report selections exist (for example, column name is listed for Sort by columns), follow this selection path to clear these selections:

    File
    [arrow]
    New
    Select No in the Save Changes dialog box.

  4. Select Output table from the Sort a Table window. The Specify Output Table window appears.

    Specify Output Table Window

    [IMAGE]

    An output table enables you to store the sorted table separately from the original table. If you do not select an output table, the sorted table overwrites the original table.

  5. In the Table field, type STYLE as the name of the output table in which you want to store the sorted data. See SAS Tables for details on assigning names to tables.

    Note:   Replace if existing enables you to replace the data in an existing table with the newly sorted data. If the STYLE table already exists, you can use this item to store the newly sorted data in place of whatever was currently stored in the STYLE table. Otherwise, you get an error message stating that the STYLE table already exists. You can either enter another name for the table or select Replace if existing to replace the existing data.  [cautionend]

  6. You can store the data temporarily or permanently. For this example, store the data temporarily.

  7. Select OK at the bottom of the window. The Sort a Table window reappears.

  8. Select Sort by columns from the Sort a Table window. Select the STYLE column first and the SQFEET column second. For more information on selecting columns, refer to Selecting a Column.

  9. Select Ordering of columns from the Sort a Table window. The Select the Ordering of Columns window appears.

    Select the Ordering of Columns Window

    [IMAGE]

    You can choose to order the data in ascending, descending, or mixed order.

  10. Select Mixed ascending and descending order.... The BY Column Sort Order window appears.

    BY Column Sort Order Window

    [IMAGE]

  11. For the STYLE column, select Ascending order. For the SQFEET column, select Descending order.

  12. Select OK. The Sort a Table window reappears.

  13. Follow this selection path:

    Run
    [arrow]
    Submit
    The table is sorted according to the specifications that you indicated. A message appears that indicates that the table was successfully sorted.

    Successful Sort Message

    [IMAGE]

  14. Select Goback to return to the Sort a Table window

  15. To see how the table has been sorted, edit or browse the WORK.STYLE table in a tabular format. The sorted table is shown in the following display.

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

    Sorted Houses Table

    [IMAGE]

    The styles of houses are listed alphabetically. Houses with a style of CONDO are first in the table. Within each style, the houses are listed from largest to smallest.


Exiting This Task

When you are finished looking at your sorted table, follow this selection path:

File
[arrow]
Close
When you are ready to return to the WorkPlace menu or move on to another task, follow the directions in Exiting a Task.


Chapter Contents

Previous

Next

Top of Page

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