Previous Page | Next Page

The PRINT Procedure

Example 2: Customizing Text in Column Headings


Procedure features:

PROC PRINT statement options:

N

OBS=

SPLIT=

STYLE

VAR statement option:

STYLE

Other features:

LABEL statement

ODS PDF statement

FORMAT statement

TITLE statement

Data set: EXPREV

This example


Program: Creating a Listing Report

 Note about code
options nodate pageno=1 linesize=80 pagesize=30 obs=10;
 Note about code
proc print data=exprev split='*' n obs='Observation*Number*===========';
 Note about code
   var country sale_type price;
 Note about code
   label country='Country Name**============'
         sale_type='Order Type**=========='
         price='Price Per Unit*in USD*==============';
 Note about code
   format price dollar10.2;
   title 'Order Type and Price Per Unit in Each Country';
run;

Output: Listing

Customizing Text in Column Headings: Listing Output

                 Order Type and Price Per Unit in Each Country                 1

     Observation    Country Name              Order Type    Price Per Unit
        Number                                                  in USD
     ===========    ============              ==========    ==============

           1        Antarctica                 Internet           $92.60  
           2        Puerto Rico                Catalog            $51.20  
           3        Virgin Islands (U.S.)      In Store           $31.10  
           4        Aruba                      Catalog           $123.70  
           5        Bahamas                    Catalog           $113.40  
           6        Bermuda                    Catalog            $41.00  
           7        Belize                     In Store          $146.40  
           8        British Virgin Islands     Catalog            $40.20  
           9        Canada                     Catalog            $11.80  
          10        Cayman Islands             In Store           $71.00  

                                     N = 10

Program: Creating a PDF Report

You can easily create PDF output by adding a few ODS statements. In the following example, ODS statements were added to produce PDF output.

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

 Note about code
ods pdf file='your_file.pdf';
proc print data=exprev split='*' n obs='Observation*Number*===========';
   var country sale_type price;
   label country='Country Name**============'
         sale_type='Order Type**=========='
         price='Price Per Unit in USD**==============';
   

   format price dollar10.2;
   title 'Order Type and Price Per Unit in Each Country';
run;

 Note about code
ods pdf close;

Output: PDF

Customizing Text in Column Headings: Default PDF Output

[Customizing Text in Column Headings: Default PDF Output]


Program: Creating a PDF Report with the STYLE Option

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

ods pdf file='your_file.pdf';

 Note about code
proc print data=exprev split='*' n obs='Observation*Number*==========='
     style(n) = {fontstyle=italic backgrouncolor= blue}
     style(header obs obsheader) = {backgrouncolor=yellow color=blue};
 Note about code
   var country sale_type price / style (data)= [ background = gray ];
   label country='Country Name**====='
         sale_type='Order Type**====='
         price='Price Per Unit in USD**========';
   format price dollar10.2;
run;
title 'Order Type and Price Per Unit in Each Country';
run;

 Note about code
ods pdf close;

Output: PDF Report with Styles

Customizing Text in Column Headings: PDF Output Using Styles

[Customizing Text in Column Headings: PDF Output Using Styles]

Previous Page | Next Page | Top of Page