Chapter Contents |
Previous |
Next |
Doing More with SAS/ASSIST Software |
Additional Information |
For additional information on changing columns from character to numeric and vice versa, refer to the PUT and INPUT functions and formats and informats in SAS Language Reference: Dictionary.
Instructions |
Tasks | Data Management | Subset/Copy |
Subset or Copy A Table Window
ORANGNUM
in the Table/View field.
ORANGNUM is a new table that you create to contain the new numeric column DAYNUM. By leaving the defaults of Temporary and Table selected, you create a temporary table in the WORK library, which is deleted when you exit the SAS System. An indicator next to Temporary and Table shows that these items are selected.
Define or Modify a Column Window
You use this window to define the new columns that you are adding to the output table.
DAYNUM
as the name
of the column.
8
.
Leave the Type as
Numeric
.
Enter Numeric Expression Window
You use this window to build an expression that is used to define the new column.
Select Type of Function Window
Select Data Window for Character Functions
Specify Arguments to a Function Window
You select INPUT(c,ifmt) because the source column DAY is character.
DAY
.
In the Value for parameter
field next to INFORM, type
2.1
.
You type
DAY
in the CHAR parameter field because
you want to use the values of the DAY column in the ORANGES table as the source
for the DAYNUM column that you are creating.
The informat 2.1 is used in this example so you can check to see that this task completed correctly. However, you can use any valid informat. In this example, if you select a format such as 1., the only indication that the new column is numeric is that it is right justified when displayed in the FSVIEW window. However, if you use 2.1 as an informat, the new column DAYNUM is right justified and converted to display tenths.
Follow this selection path:
Run | Submit |
The new DAYNUM column is created, and the data is copied to the output table. An FSVIEW window appears with the data in the output table.
New DAYNUM Column
To confirm that the column is numeric, browse the properties of the table. See Altering the Properties of a SAS Table for more information.
File | Close |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.