Procedure features: |
PROC FORMAT statement option:
|
Input Control Data Set |
|
Data sets: |
|
This example shows how to create a format from a SAS data set.
Tasks include
- creating a format from an input control data
set
- creating an input control data set from an existing SAS data set.
libname proclib 'SAS-data-library-1';
libname library 'SAS-data-library-2';
options nodate pageno=1 linesize=80 pagesize=60;
 | data proclib.scale;
input begin $ 1-2 end $ 5-8 amount $ 10-12;
datalines;
0 3 0%
4 6 3%
7 8 6%
9 10 8%
11 16 10%
; |
 | data ctrl(rename=(begin=start amount=label));
set proclib.scale end=last; |
 | retain fmtname 'ptsfrmt' type 'n'; |
 | if last then hlo='h';
else hlo=' ';
run; |
 | proc print data=ctrl noobs;
title 'The CTRL Data Set';
run; |
 | proc format library=library cntlin=ctrl;
run; |
 | proc report data=proclib.points nowd colwidth=12;
column employeeid totalpoints totalpoints=Pctage;
define pctage / format=ptsfrmt10. 'Percentage';
title 'The Percentage of Salary For Calculating Bonus';
run;
|
PROC PRINT output
|
|
![[Listing Output]](../common/images/outlist.gif) |
PROC REPORT output
|
|
![[Listing Output]](../common/images/outlist.gif) |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.