Previous Page | Next Page

Working with Character Variables

Learning More

Character values

This section illustrates the flexibility that SAS provides for manipulating character values. In addition to the functions that are described in this section, the following character functions are also frequently used:

COMPBL

removes multiple blanks from a character string.

COMPRESS

removes specified character(s) from the source.

INDEX

searches the source data for a pattern of characters.

LOWCASE

converts all letters in an argument to lowercase.

RIGHT

right-aligns the source.

SUBSTR

extracts a group of characters.

TRANSLATE

replaces specific characters in a character expression.

UPCASE

returns the source data in uppercase.

The INDEX and UPCASE functions are discussed in Acting on Selected Observations. Complete descriptions of all character functions appear in SAS Language Reference: Dictionary.

Character variables

Detailed information about character variables is found SAS Language Reference: Concepts.

Additional information about aligning character variables is explained in the TEMPLATE procedure in SAS Output Delivery System: User's Guide, and in the REPORT procedure in Base SAS Procedures Guide.

Comparing uppercase and lowercase characters

How to compare uppercase and lowercase characters is shown in Acting on Selected Observations.

Concatenation operator

Information about the concatenation operator can be found in SAS Language Reference: Concepts.

DATASETS procedure

Using the DATASETS procedure to display the length of variables in a SAS data set is explained in Getting Information about Your SAS Data Sets.

IF-THEN statements

A detailed explanation of the IF-THEN statements can be found in Acting on Selected Observations.

Informats and formats

Complete information about the SAS System's numerous informats and formats for reading and writing character variables is found in SAS Language Reference: Dictionary.

Missing values

Detailed information about missing values is found in SAS Language Reference: Concepts.

VLENGTH function

The VLENGTH function is explained in detail in SAS Language Reference: Dictionary.

Previous Page | Next Page | Top of Page