Support Tips

Source and Target
Bill Holenstein
Bill Holenstein
Sr. Manager, Shadowbase Product Support

Real-time Data Conversions using Shadowbase's open DBS Mapping Facility

Effective with Shadowbase version OSB4.030 for the open server, there is a new feature that allows one to dynamically transform an alphanumeric or character data string through the use of reference modifiers. Previous versions only supported whole value transformations, whereas this new function allows the user to pick apart string data character by character as the event flows through the replication engine.

This function is available by setting the SHAD_SHADUSRX_PROCESSING=1 in the SHADPARM.INI, and then formatting the column to be converted in the process's SHADDBS.INI file. Previous versions of Shadowbase would require a userexit to perform this level of data transformation.

For example:

Assume a source Enscribe file (called TESTDAT2) contains a date field (called DAT), and it has a PIC 9(6) format (i.e., a 6-digit string of the form YYMMDD). Assume the value of this “number” is '80916' (which is really ‘080916’, or September 16, 2008). Also assume that the target table’s (TESTDAT2) DAT column is an Oracle DATE data type, that needs to be in the format TO_DATE('2008-09-16','yyyy-mm-dd') for the insert to work.

In SHADPARM.INI, set the SHAD_SHADUSRX_PROCESSING=1 flag to invoke the Shadowbase data mapping facility. The SHADDBS.INI file will then contain the following commands:

[DBS+]TESTDAT2
[FLD+]DAT=%DAT:1:6:+000000%
[FLD+]DAT=TO_DATE('20%DAT:1:2%-%DAT:3:2%-%DAT:5:2%','YYYY-MM-DD')

These commands first identify the table to work with ([DBS+]TESTDAT2). They then right-justify the incoming 5 digit character string for the DAT column (‘80916’) in the 6 digit ‘000000’ template ([FLD+]DAT=%DAT:1:6:+000000%), followed by picking apart the incoming 6 digits into the year, month, and day, and adding them to the formatted string for submission to Oracle.

So as you can see, we have come up with a simple yet powerful solution to a chronic problem.

Home | Exec. VP Letter | Sales & Marketing | Shadowbase Support Tip | Case Study | Development Update | Employee Spotlight