Appendix 3
Example Code Shown in Using
the SQL Procedure
This appendix shows the example code for the whole section of “Using the SQL
Procedure.” If you copy and paste the code to a SAS editor, the code spacing is
preserved if you copy the code from an HTML page.
Introduction to the SQL Procedure
Some output tables restrict the number of observations. To list the entire table, remove
the PROC SQL OUTOBS= option.
/*-------------------------------------------------------------------
Output 1.1 Sample SQL Output
-------------------------------------------------------------------*/
proc sql;
title 'Population of Large Countries Grouped by Continent';
select Continent, sum(Population) as TotPop format=comma15.
from sql.countries
where Population gt 1000000 ...