Converting Data with Functions
A Word About Converting Data
The following code automatically converts the variable PayRate from character to numeric.
data hrd.newtemp; set hrd.temp; Salary=payrate*hours; run;
You can also use the INPUT function before performing a calculation. The INPUT function converts character data values to numeric values.
You can use the PUT function to convert numeric data values to character values.
Potential Problems of Omitting INPUT or PUT
If you skip INPUT or PUT function when converting data, SAS detects the mismatched variables and tries an automatic character-to-numeric or numeric-to-character conversion. However, this action is not always successful. Suppose each value of PayRate begins with a dollar ...