| The FORMAT Procedure |
| Procedure features: |
|
This example does the following:
prefixes the formatted value with a specified character
fills the leading blanks with a specified character
shows the interaction between the FILL= and PREFIX= options
| Program |
| |
options nodate pageno=1 linesize=64 pagesize=40; |
| |
data pay; input Name $ MonthlySalary; datalines; Liu 1259.45 Lars 1289.33 Kim 1439.02 Wendy 1675.21 Alex 1623.73 ; |
| |
proc format; picture salary low-high='00,000,000.00' (fill='*' prefix='$'); run; |
| |
proc print data=pay noobs; format monthlysalary salary.; |
| |
title 'Printing Salaries for a Check'; run; |
| Output: Listing |
Printing Salaries for a Check 1
Name MonthlySalary
Liu ****$1,259.45
Lars ****$1,289.33
Kim ****$1,439.02
Wendy ****$1,675.21
Alex ****$1,623.73
| Output: HTML |
![[untitled graphic]](images/chap18-ex9.gif)
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.