Chapter Contents

Previous

Next
The FORMAT Procedure

Example 1: Creating a Picture Format


Procedure features:
PROC FORMAT statement options:
LIBRARY=
PICTURE statement options:
MULT=
PREFIX=
LIBRARY libref
LOW and HIGH keywords
Data set:
PROCLIB.STAFF .

This example uses a PICTURE statement to create a format that prints the values for SALARY in the data set PROCLIB.STAFF in U.S. dollars.



Program
 Note about code
libname proclib 'SAS-data-library-1 ';
libname library 'SAS-data-library-2';

options nodate pageno=1 linesize=80 pagesize=40;


 Note about code
   proc format library=library;


 Note about code
      picture uscurr low-high='000,000' (mult=1.61 prefix='$');
   run;





 Note about code
proc print data=proclib.staff noobs label;
   label salary='Salary in U.S. Dollars';
   format salary uscurr.;
   title 'PROCLIB.STAFF with a Format for the Variable Salary';
run;


Output
[HTML Output]  [Listing Output]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.