Table of Contents

Search

  1. Preface
  2. The Transformation Language
  3. Constants
  4. Operators
  5. Dates
  6. Functions
  7. Creating Custom Functions
  8. Custom Function API Reference
  9. POWERCENTERHELP

Transformation Language Reference

Transformation Language Reference

IS_SPACES

IS_SPACES

Returns whether a string value consists entirely of spaces. A space is a blank space, a formfeed, a newline, a carriage return, a tab, or a vertical tab.
IS_SPACES evaluates an empty string as FALSE because there are no spaces. To test for an empty string, use LENGTH.

Syntax

IS_SPACES(
value
)
The following table describes the argument for this command:
Argument
Required/
Optional
Description
value
Required
Must be a string datatype. Passes the rows you want to evaluate. You can enter any valid transformation expression.

Return Value

TRUE (1) if the row consists entirely of spaces.
FALSE (0) if the row contains data.
NULL if a value in the expression is NULL.

Example

The following expression checks the ITEM_NAME port for rows that consist entirely of spaces:
IS_SPACES( ITEM_NAME )
ITEM_NAME
RETURN VALUE
Flashlight
0 (False)
      
1 (True)
Regulator system
0 (False)
NULL
NULL
''
0 (FALSE) (
Empty string does not contain spaces.)
Use IS_SPACES to avoid writing spaces to a character column in a target table. For example, if you have a transformation that writes customer names to a fixed length CHAR(5) column in a target table, you might want to write ‘00000’ instead of spaces. You would create an expression similar to the following:
IIF( IS_SPACES( CUST_NAMES ), '00000', CUST_NAMES )