$CTMUtil Variable

The predefined $CTMUtil variable provides access to some common utilities. Several methods are currently available.

quotestring Method

Short Description
encloses a string in single quotation marks.
Syntax
String quoteString(String input)
Parameter
input
the input string that you want to enclose in single quotation marks.
Return Value
returns a string that represents the quoted value. Single quotation marks are added to the input string. Any single quotation marks that are found in the original string are preserved by adding another single quotation mark.
Example
#set( $input="Person's" )
$CTMUtil.quoteString($input);

/* string returned: 'Person''s' */

toSASName Method

Short Description
transforms a string so that it uses SAS naming conventions.
Syntax
String toSASName(String input)
Parameter
input
the input string to transform.
Return Value
returns a string that represents the transformed input string. For example, if the input string is ‘My Variables’, the returned string would be “’My Variables”n’.
Example
#set( $input="My Variable" )
$CTMUtil.toSASname($input);


/* string returned: "My Variable"n */