Hello. I’m using the Tranform Editor of IBM Initiate Workbench 9.7.0 to convert the CTL in a Reformat transformer from CTL1 to CTL2. The transformer is reading in a .txt file made by a Reformat in Phase 0 of the graph and applying a random birthdate to each record. Works fine in CTL1. The Editor is giving me an error when I convert to the randomDate code: Function ‘Today’ is not declared
I’m using the today() function. So, somewhere I don’t have my transform pointed to some global cache of functions. Any help would be appreciated.
Code that works as is:
//#TL
// Transforms input record into output record.
function transform() {
$0.* := $0.*; // stage all fields ‘as is’ to output port 0
$0.BirthDate := random_date($0.BirthDate,today(),“yyyyMMdd”,0); // convert birthdate to a random date
}
New Code with ‘is not declared’ error:
//CTL2
// Transforms input record into output record.
function int transform() {
$0.BirthDate = $0.BirthDate;
$0.Name = $0.Name;
$0.BirthDate = randomDate($0.BirthDate,today(),“yyyyMMdd”,0); // convert birthdate to a random date
return 0;
}
The Properties for this transformer is generic (perhaps my problem)
Basic
Transform: //CTL2//Transforms input…
Transform URL:
Transform class:
Transform source charset: ISO-8859-2 (from Dataparser DEFAULT_CHARSET_DECODER in default Properties)
Advanced
Error actions:
Error log
Visual
Component name: MASK PII
Description: Mask PII - Birthdate is randomized
Location: Point(294,188)
Size: (Dimension(0,0)
Common
ID: REFORMAT2
Component type: REFORMAT
Specification: Recevies data thrugh input port, transforms them in a user specific way,…
Phase: 1
Enabled: enabled
Pass through Input port:
Pass through Output port:
Again, I need a hint where to find today() function. Thanks.