Return to Homepage

Goto the Tip of the Month Archive

Other interesting pages ...
LinkedIn Profile
SAS Cheat Sheet
Useful SAS Code
Full SAS Example
Basic Statistics
Contact Information

SAS Tip of the Month
October 2010
(for SAS and WPS)

Using the LABEL and NOOBS options in the PRINT procedure can make your output look better. Refer to the example below:

   === PROGRAM ===
   data reg_cars_US;
	  label year='Year'
	        number='Number of Registered Passenger Cars';
	  format number comma15.;
	  infile cards;
	  input year number comma11.;
	cards;
	2003 135,669,897
	2004 136,430,651
	2005 136,568,083
	2006 135,399,945
	2007 135,932,930
	2008 137,079,843
	;
	proc print data=reg_cars_US;
	   title1 "Listing Without LABEL and NOOBS Options";
	run;
	proc print data=reg_cars_US LABEL NOOBS;
	   title1 "Listing With LABEL Statement";
	run;


   === OUTPUT ===
   Listing Without LABEL and NOOBS Options

        Obs    year             number

         1     2003        135,669,897
         2     2004        136,430,651
         3     2005        136,568,083
         4     2006        135,399,945
         5     2007        135,932,930
         6     2008        137,079,843


         Listing With LABEL Statement

                         Number of
                        Registered
           Year     Passenger Cars

           2003        135,669,897
           2004        136,430,651
           2005        136,568,083
           2006        135,399,945
           2007        135,932,930
           2008        137,079,843

For those who did not notice, the line under the month at the top of the page has a reference to WPS as well as SAS. In an editorial decision, starting this month I will make a reference to whether the tip relates to SAS and WPS, SAS alone, or WPS alone. In the majority of cases the tips will be for both SAS and WPS, but there could be occasions where they relate to one or the other.

See you in November.

________________________________
Updated October 10, 2010