This example uses an INVALUE statement to create a
numeric informat
that converts numeric and character raw data to numeric data.
libname proclib 'SAS-data-library-1';
libname library 'SAS-data-library-2';
options nodate pageno=1 linesize=64 pagesize=40;
| proc format library=library; |
| invalue eval 'O'=4
'S'=3
'E'=2
'C'=1
'N'=0;
run; |
| data proclib.points;
input EmployeeId $ (Q1-Q4) (eval.,+1);
TotalPoints=sum(of q1-q4);
datalines;
2355 S O O S
5889 2 2 2 2
3878 C E E E
4409 0 1 1 1
3985 3 3 3 2
0740 S E E S
2398 E E C C
5162 C C C E
4421 3 2 2 2
7385 C C C N
; |
| proc print data=proclib.points noobs;
title 'The PROCLIB.POINTS Data Set';
run; |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.