Chapter Contents

Previous

Next
The SQL Procedure

column-modifier


Sets column attributes.

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=)
INFORMAT= specifies the informat to be used when SAS accesses data from a table or view. You can change one permanent informat to another by using the ALTER statement. PROC SQL stores informats in its table definitions so that other SAS procedures and the DATA step can use this information when they reference tables created by PROC SQL.


Specifying Formats for Columns (FORMAT=)
FORMAT= determines how character and numeric values in a column are displayed by the query-expression. If the FORMAT= modifier is used in the ALTER, CREATE TABLE, or CREATE VIEW statements, it specifies the permanent format to be used when SAS displays data from that table or view. You can change one permanent format to another by using the ALTER statement.

See SAS Language Reference: Dictionary for more information on informats and formats.


Specifying Labels for Columns (LABEL=)
LABEL= associates a label with a column heading. If the LABEL= modifier is used in the ALTER, CREATE TABLE, or CREATE VIEW statements, it specifies the permanent label to be used when displaying that column. You can change one permanent label to another by using the ALTER statement.

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.