Technical Blog Post
Abstract
Simple User Exits to manipulate data in the Map Editor
Body
Sometimes when you need to manipulate the data, it seems like it will take quite a few lines of extended rules to get your desired results.
A classic example is converting your data to all uppercase. It can definitely be done with extended rules, looping thru each character.
However, you can simplify it to just 3 lines of rules if you use an user exit.
I know user exits are scary, especially since support doesn't support them, but if you're just needing to manipulate data, and there's already a java function that does it, it's really quite simple. You do not need to create your own .jar files and become a java programmer to get it done. Granted, there is still that option for those that want to do a lot more with user exits, but for now we're just going to look at the simple data manipulation.
The overall approach is to find a function in a java class such as java.lang.String, that gets included automatically, and then pass the data to the function and store the results.
Using the uppercase example, it'd simply look like:
object ob;
#Field = ob.toUpperCase(); //Store the value of the converted Java String (#Text) into #Field
Pretty simple and easy to do.
Here is a link to a .pdf file that breaks the rules down and explains what each line means. There's also a few examples and links to where you can find the java functions.
So the next time you start to write a bunch of rules to manipulate your data, you may want to check and see if you're reinventing the wheel and use an user exit instead.
UID
ibm11121967