IBM Books

Reference

DTW_STRIP


AIX HP-UX Linux OS/2 OS/390 OS/400 SCO SUN Win NT
X X X X X X X X X

Purpose

Removes leading blanks, trailing blanks, or both from a string.

Format

@DTW_STRIP(stringIn, option, stringOut)

@DTW_STRIP(stringIn, stringOut)

@DTW_rSTRIP(stringIn, option)

@DTW_rSTRIP(stringIn)

Parameters

Table 96. DTW_STRIP Parameters

Data Type Parameter Use Description
string stringIn IN A variable or literal string.
string option IN Specifies which blanks to remove from stringIn. The default is B.

B or b - remove both leading and trailing blanks

L or l - remove leading blanks only

T or t - remove trailing blanks only

string stringOut OUT A variable that contains stringIn with blanks removed as specified by option.

Return Codes

Table 97. DTW_STRIP Return Codes

Return Code Explanation
-1001 The server could not process a Net.Data request to allocate memory.
1001 An input parameter contained a NULL value.
1003 The number of parameters passed on a function call either exceeded the maximum number allowed, or was less than the minimum number required by the function.
1005 A parameter passed on a function call, required to be a string variable, was of a different variable type.
1006 A literal string was passed on a function call for a parameter which was required to be an output parameter.
1007 A parameter contains a value which is not valid.

Examples

Example 1:

@DTW_STRIP("  day ", result)

Example 2:

@DTW_STRIP("  day ", "T", result)

Example 3:

@DTW_rSTRIP("  a day  ", "L")


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]