Controlling Output

Including a Column of Row Numbers

The NUMBER | NONUMBER option specifies whether the output from a query should include a column named ROW, which displays row numbers. NONUMBER is the default. The option is similar to the NOOBS option in the PRINT procedure.

Example

The following PROC SQL step specifies the NUMBER option. Output from the step includes a column named Row, which contains row numbers.
proc sql inobs=10 number;
   select flightnumber, destination 
      from sasuser.internationalflights;
PROC SQL Output with Number Option

Double-Spacing Output

In some cases, double-spacing your output can make it easier to read. The DOUBLE | NODOUBLE option specifies whether PROC SQL output is double-spaced. The default is NODOUBLE.
Note: The DOUBLE | NODOUBLE option does not affect the appearance of the HTML, PDF, or RTF output. To see the effect of this option, select the text in SAS Enterprise Guide.

Example

The following PROC SQL step specifies the DOUBLE option. The listing output from this step is double spaced. The HTML output from this step remains single-spaced.
proc sql inobs=10 double; 
   select flightnumber, destination 
      from sasuser.internationalflights;
Figure 8.1 Listing Output
Listing Output
Figure 8.2 HTML Output
HTML Output

Flowing Characters within a Column

The FLOW | NOFLOW | FLOW=n | FLOW=n m option controls the appearance of wide character columns in listing output. The FLOW option causes text to be flowed in its column instead of wrapping the entire row. Specifying n sets the width of the flowed column. Specifying n and m floats the width of the column between limits to achieve a balanced layout.
Note: The FLOW | NOFLOW | FLOW=n | FLOW=nm option does not affect the appearance of HTML, PDF, or RTF output. To see the effect of this option, select the text output in SAS Enterprise Guide.

Example

The following PROC SQL step does not specify the FLOW option. Notice that in the output the name and values for the column ZipCode appear under the name and values for the column FFID due to the wide character columns.
proc sql inobs=5;
   select ffid, membertype, name, address, city, 
          state, zipcode
      from sasuser.frequentflyers
      order by pointsused;
Figure 8.3 Output from PROC SQL Step without FLOW Option
Output from PROC SQL Step without FLOW Option
Specifying flow=10 15 causes the text within each character column to float between 10 and 15 spaces, which prevents the ZipCode column from wrapping underneath the FFID column.
 proc sql inobs=5 flow=10 15;
    select ffid, membertype, name, address, city, 
           state, zipcode
       from sasuser.frequentflyers
       order by pointsused;
Figure 8.4 Output from PROC SQL Step with FLOW Option
Output from PROC SQL Step with FLOW Option
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.126.56