29.12.2013 Views

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

468 Output 4 Chapter 23<br />

Output<br />

PROCLIB.STAFF with a Format for the Variables 1<br />

Salary and Site<br />

Salary in<br />

Id U.S. Hire<br />

Name Number Dollars Site Date<br />

Capalleti, Jimmy 2355 $34,072 Birmingham UK 30JAN79<br />

Chen, Len 5889 $33,771 Birmingham UK 18JUN76<br />

Davis, Brad 3878 $31,509 Plymouth UK 20MAR84<br />

Leung, Brenda 4409 $55,256 Plymouth UK 18SEP74<br />

Martinez, Maria 3985 $78,980 Miami USA 10JAN93<br />

Orfali, Philip 0740 $80,648 Miami USA 16FEB83<br />

Patel, Mary 2398 $56,643 York UK 02FEB90<br />

Smith, Robert 5162 $64,561 INCORRECT CODE 15APR86<br />

Sorrell, Joseph 4421 $62,403 Denver USA 19JUN93<br />

Zook, Carla 7385 $37,010 York UK 18DEC91<br />

Example 3: Writing a Format for Dates Using a Standard <strong>SAS</strong> Format<br />

Procedure features:<br />

VALUE statement:<br />

HIGH keyword<br />

Data set:<br />

PROCLIB.STAFF on page 463.<br />

Formats:<br />

USCurrency. on page 465 and $CITY. on page 467.<br />

This example uses an existing format that is supplied by <strong>SAS</strong> as a formatted value.<br />

Tasks include<br />

3 creating a numeric format<br />

3 nesting formats<br />

3 writing a format using a standard <strong>SAS</strong> format<br />

3 formatting dates.<br />

Program<br />

This program defines a format called BENEFIT, which differentiates between<br />

employees hired on or before 31DEC1979. The purpose of this program is to indicate<br />

any employees who are eligible to receive a benefit, based on a hire date on or prior to<br />

December 31, 1979. All other employees with a later hire date are listed as ineligible<br />

for the benefit.<br />

Assign two <strong>SAS</strong> library references (PROCLIB and LIBRARY). Assigning a library<br />

reference LIBRARY is useful in this case because if you use PROC FORMAT, then <strong>SAS</strong><br />

automatically searches for informats and formats in any library that is referenced with the<br />

LIBRARY libref.<br />

libname proclib ’<strong>SAS</strong>-data-library-1’;<br />

libname library ’<strong>SAS</strong>-data-library-2’;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!