O'Reilly logo

SAS Functions by Example, Second Edition, 2nd Edition by Ron Cody

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Functions That Extract Parts of Strings

The functions described in this section can extract parts of strings. When used on the left-hand side of the equal sign, the SUBSTR function can also be used to insert characters into specific positions of an existing string.

Function:   SUBSTR

Purpose:    To extract part of a string. When the SUBSTR function is used on the left side of the equal sign, it can place specified characters into an existing string.

Syntax:      SUBSTR(character-value, start <,length>)

character-value is any SAS character value.

start is the starting position within the string.

length, if specified, is the number of characters to include in the substring. If this argument is omitted, the SUBSTR function will return all the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required