Converting Data with Functions

Introduction to Converting Data

Suppose you are asked to complete a number of modifications to the data set Hrd.Temp. The first modification is to create a new variable that contains the salary of temporary employees. Examining the data set, you realize that one of the variables needed to calculate salaries is the character variable PayRate. To complete the calculation, you need to convert PayRate from character to numeric.
SAS Data Set Hrd.Temp
data hrd.newtemp; 
   set hrd.temp; 
   Salary=payrate*hours; 
run;
In such cases, you should use the INPUT function before attempting the calculation. The INPUT function converts character ...

Get SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.