Chapter Contents |
Previous |
Next |
The SQL Procedure |
See also: | column-definition and SELECT Clause |
Featured in: | Creating a Table and Inserting Data into It and Creating a Table from a Query's Result |
<INFORMAT=informatw.d> |
<FORMAT=formatw.d> |
<LABEL='label'> |
<LENGTH=length> |
Specifying Informats for Columns (INFORMAT=) |
Specifying Formats for Columns (FORMAT=) |
See SAS Language Reference: Dictionary for more information on informats and formats.
Specifying Labels for Columns (LABEL=) |
If you refer to a labeled column in the ORDER BY or GROUP BY clause,
you must use either the column name (not its label), the column's alias, or
its ordering integer (for example,
ORDER BY 2
). See the section on SAS
statements in SAS Language Reference: Dictionary for more information on labels.
A label can begin with the following characters: a through z, A through Z, 0 through 9, an underscore (_), or a blank space. If you begin a label with any other character, such as pound sign (#), that character is used as a split character and it splits the label onto the next line wherever it appears. For example:
select dropout label= '#Percentage of#Students Who#Dropped Out' from educ(obs=5);
If you need a special character to appear as the first character in the output, precede it with a space or a forward slash (/).
You can omit the LABEL= part of the column-modifier and still specify a label. Be sure to enclose the label in quotes. For example:
select empname "Names of Employees" from sql.employees;
If you need an apostrophe in the label, type it twice so that the SAS System reads the apostrophe as a literal. Or, you can use single and double quotes alternately (for example, "Date Rec'd").
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.