Book Image

SAP Data Services 4.x Cookbook

Book Image

SAP Data Services 4.x Cookbook

Overview of this book

Want to cost effectively deliver trusted information to all of your crucial business functions? SAP Data Services delivers one enterprise-class solution for data integration, data quality, data profiling, and text data processing. It boosts productivity with a single solution for data quality and data integration. SAP Data Services also enables you to move, improve, govern, and unlock big data. This book will lead you through the SAP Data Services environment to efficiently develop ETL processes. To begin with, you’ll learn to install, configure, and prepare the ETL development environment. You will get familiarized with the concepts of developing ETL processes with SAP Data Services. Starting from smallest unit of work- the data flow, the chapters will lead you to the highest organizational unit—the Data Services job, revealing the advanced techniques of ETL design. You will learn to import XML files by creating and implementing real-time jobs. It will then guide you through the ETL development patterns that enable the most effective performance when extracting, transforming, and loading data. You will also find out how to create validation functions and transforms. Finally, the book will show you the benefits of data quality management with the help of another SAP solution—Information Steward.
Table of Contents (19 chapters)
SAP Data Services 4.x Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Using string functions


Here, we will explore a few useful string functions by updating our HelloWorld code to include some extra functionality. There is only one data type in Data Services used to store character strings, and that is varchar. It keeps things pretty simple for string-related and conversion operations.

How to do it…

Here, you will see two examples: applying string functions transformation within a dataflow and using string functions in the script object.

Follow these steps to use string functions in Data Services using the example of the replace_substr() function, which substitutes part of the string with another substring:

  1. Open the DF_HelloWorld dataflow in the workspace window and add a new Query transform named Who_says_What. Put it after the Query transform and before the target template table.

  2. Open the Who_says_What Query transform and add a new WHO_SAYS_WHAT output column of the varchar(100) type.

  3. Add the following code into a mapping tab of the new column:

    replace_substr(...