PR000041 practice question 2 of 15

What function could be used to exchange 'i' with 'I' in the COMPANY port given the following expression? function name{1, COMPANY, 'i' , 'I')

Full set: 69 questions
Answer options
A: CHOOSE
B: REPLACECHR Correct answer
C: REG_REPLACE
D: INSTR
Correct Answer:
B. REPLACECHR
Explanation

The REPLACECHR function is designed to replace a set of characters within a string with another character. The syntax is REPLACECHR(CaseFlag, InputString, OldCharSet, NewChar). The expression in the question, function name(1, COMPANY, 'i', 'I'), directly maps to this syntax. The first argument, 1, sets the function to be case-insensitive. The function will search for every character in the OldCharSet ('i') within the InputString (the COMPANY port) and replace it with the NewChar ('I').

Why Incorrect

A. CHOOSE: This is a conditional function that returns one of two specified values based on the result of a boolean condition; it does not perform string replacement.
C. REGREPLACE: This function replaces substrings based on a regular expression pattern. While it could achieve the result, its syntax (subject, pattern, newstring) does not match the provided expression's structure.
D. INSTR: This function returns the numeric starting position of a substring within a string. It is used for searching, not for replacing characters.

References

1. Informatica PowerCenter 10.2.0

Transformation Language Reference

Chapter 18: Functions

"REPLACECHR"

Page 398.

Quote: "Replaces characters in a string with a single character or no character... Syntax: REPLACECHR (CaseFlag

InputString

OldCharSet

NewChar)... Example: REPLACECHR(1

'Sessan'

's'

'X') returns 'XeXXan'." This confirms the function's purpose and syntax match the question's requirements.

2. Informatica PowerCenter 10.2.0

Transformation Language Reference

Chapter 18: Functions

"CHOOSE"

Page 298.

Quote: "Tests a condition and returns one of two values that you specify... Syntax: CHOOSE( condition

value1

value2 )." This shows it is a conditional

not a string manipulation function.

3. Informatica PowerCenter 10.2.0

Transformation Language Reference

Chapter 18: Functions

"REGREPLACE"

Page 392.

Quote: "Replaces characters in a string with a character string that you specify... Syntax: REGREPLACE( subject

pattern

newstring )." This confirms a different syntax and purpose (regex-based) from what is required.

4. Informatica PowerCenter 10.2.0

Transformation Language Reference

Chapter 18: Functions

"INSTR"

Page 338.

Quote: "Searches a string for a substring and returns the position of the substring... Syntax: INSTR( string

substring [

start [

occurrence]] )." This confirms the function is for finding positions

not replacement.

Question breakdown

Tests
Transformation language string functions
Difficulty
Easy

Key idea: REPLACECHR(CaseFlag, InputString, OldCharSet, NewChar) swaps each character found in a character set for one replacement character, and its four-argument shape matches the expression.

How to reach the answer

  1. Map the argument pattern: an integer flag, a port, an old character, and a new character.
  2. Recall which function begins with a case flag followed by a string and two character arguments. That is REPLACECHR.
  3. Confirm the goal is replacement, which rules out search functions like INSTR.
  4. REG_REPLACE takes subject, pattern, and replacement with no leading case flag, so its signature does not fit.
  5. CHOOSE only selects a value by index and never alters a string.

Each option

  • AIncorrect. CHOOSE returns one value from a list based on an index position; it does not modify characters inside a string.
  • BCorrect. REPLACECHR uses exactly this signature: a non-zero CaseFlag makes the match case-sensitive, and each 'i' in COMPANY becomes 'I'.
  • CIncorrect. REG_REPLACE is regex-based, takes subject, pattern, and replacement with an optional count, and has no leading case flag.
  • DIncorrect. INSTR returns the position of a substring and performs no replacement.

Common trap: REG_REPLACE sounds like the obvious 'replace' function, but its argument order does not match an expression that starts with a case flag.

In practice: REPLACECHR is commonly used in Expression transformations to clean or normalize characters, such as stripping punctuation or fixing casing in name and code fields.

Remember: An integer case flag as the first argument followed by a string points to REPLACECHR or REPLACESTR; a non-zero flag means case-sensitive.

Drafted with AI assistance and checked against the answer key.

Keep practicing

Take the free PR000041 practice test

Ten exam-style questions with answers and explanations, plus the exam facts and study guides.

Start the free practice test

More questions

Other PR000041 practice questions

Scroll to Top