Procedure features: |
|
Data set: |
|
Formats: |
|
This example uses an existing format that is supplied by SAS as a
formatted
value.
Tasks include the following:
This program defines a format called BENEFIT, which differentiates between
employees hired on or before 31DEC1979. The purpose of this program is to
indicate any employees who are eligible to receive a benefit, based on a hire
date on or before December 31, 1979. All other employees with a later hire
date are listed as ineligible for the benefit.
|
libname proclib 'SAS-library-1';
libname library 'SAS-library-2'; |
|
options nodate pageno=1 linesize=80 pagesize=40; |
|
proc format library=library; |
|
value benefit low-'31DEC1979'd=[worddate20.] |
|
'01JAN1980'd-high=' ** Not Eligible **';
run; |
|
proc print data=proclib.staff noobs label; |
|
label salary='Salary in U.S. Dollars'; |
|
format salary uscurrency. site $city. hiredate benefit.; |
|
title 'PROCLIB.STAFF with a Format for the Variables';
title2 'Salary, Site, and HireDate';
run; |
PROCLIB.STAFF with a Format for the Variables 1
Salary, Site, and HireDate
Salary in
Id U.S.
Name Number Dollars Site HireDate
Capalleti, Jimmy 2355 $34,072 Birmingham UK January 30, 1979
Chen, Len 5889 $33,771 Birmingham UK June 18, 1976
Davis, Brad 3878 $31,509 Plymouth UK ** Not Eligible **
Leung, Brenda 4409 $55,256 Plymouth UK September 18, 1974
Martinez, Maria 3985 $78,980 Miami USA ** Not Eligible **
Orfali, Philip 0740 $80,648 Miami USA ** Not Eligible **
Patel, Mary 2398 $56,643 York UK ** Not Eligible **
Smith, Robert 5162 $64,561 INCORRECT CODE ** Not Eligible **
Sorrell, Joseph 4421 $62,403 Denver USA ** Not Eligible **
Zook, Carla 7385 $37,010 York UK ** Not Eligible **
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.