Using the Output Delivery System in the DATA Step |
ODS features: |
FILE statement, ODS option:
|
ODS HTML statement:
|
PUT _ODS_ |
|
Format: |
$CNTRY.
|
This example selects variables to write to the data
component. The output is routed to two ODS destinations: the Listing destination,
which is open by default, and the HTML destination, which is opened by the
ODS HTML statement.
Note: This example uses file names that may not be valid
in all operating environments. To successfully run the example in your operating
environment, you may need to change the file specifications. See Alternative ODS HTML Statements for Running Examples in Different Operating Environments.
| options pagesize=60 linesize=64 nodate pageno=1; |
| ods html body='selectvars-body.htm'; |
| title 'Leading Grain Producers';
title2 'for 1996'; |
| data _null_;
length Country $ 3 Type $ 5;
input Year country $ type $ Kilotons;
if year=1996;
format country $cntry.;
label type='Grain'; |
| file print ods=(variables=(country
type
kilotons)); |
| put _ods_; |
| datalines;
1995 BRZ Wheat 1516
1995 BRZ Rice 11236
1995 BRZ Corn 36276
... more lines of data ...
1996 USA Wheat 62099
1996 USA Rice 7771
1996 USA Corn 236064
; |
| ods html close; |
Body File Produced by the HTML Destination
Listing Output Produced by the Listing Destination
Leading Grain Producers 1
for 1996
Country Grain Kilotons
Brazil Wheat 3302
Brazil Rice 10035
Brazil Corn 31975
China Wheat 109000
China Rice 190100
China Corn 119350
India Wheat 62620
India Rice 120012
India Corn 8660
Indonesia Wheat .
Indonesia Rice 51165
Indonesia Corn 8925
United States Wheat 62099
United States Rice 7771
United States Corn 236064 |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.