Converting Data with Functions

A Word about Converting Data

The following code automatically converts the variable PayRate from character to numeric.
data work.newtemp;
  set cert.temp;
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 ...

Get SAS Certified Specialist Prep Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.