Procedure features: |
PROC FORMAT statement options:
|
|
Other features: |
|
Data sets: |
|
This example uses the LIBRARY= option and the
FMTSEARCH= system option
to store and retrieve a format stored in a catalog other than WORK.FORMATS
or LIBRARY.FORMATS.
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
libname proclib 'SAS-library'; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
options nodate pageno=1 linesize=64 pagesize=60; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
proc format library=proclib; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
picture nozeros
low - -1 = '00.00' (prefix='-' )
-1 <-< 0 = '99' (prefix='-.' mult=100)
0 -< 1 = '99' (prefix='.' mult=100)
1 - high = '00.00';
run; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
options fmtsearch=(proclib); |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
proc print data=sample;
format amount nozeros.; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
title1 'Retrieving the NOZEROS. Format from PROCLIB.FORMATS';
title2 'The SAMPLE Data Set';
run; |
Retrieving the NOZEROS. Format from PROCLIB.FORMATS 1
The SAMPLE Data Set
Obs Amount
1 -2.05
2 -.05
3 -.02
4 .00
5 .09
6 .54
7 .56
8 6.60
9 14.63
![[untitled graphic]](images/chap18-ex7.gif)
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.