REFORMAT - Closing single quote missing

Hi,
I have following error in my flow:


INFO  [WatchDog] - compile Class: TransformTransformREFORMAT0 by Janino compiler
ERROR [WatchDog] - Error when creating object of class: Line 61, Column 82: Closing single quote missing
org.codehaus.janino.Scanner$ScanException: Line 61, Column 82: Closing single quote missing

The transformation source code looks following:


...
${out.0.FILE_NAME} = ${in.0.FILE_NAME};
${out.0.PERIOD} = str2date('20070101', 'yyyyMMdd');

Line 61, Column 82 is str2date function. I’ve copied example from functions listing.
What am I doing wrong?

Hi, you mix CTL and CTLLite. You transformation should be:

function transform(){
.
.
$0.FILE_NAME:=$0.FILE_NAME;
$0.PERIOD:=str2date('20070101', 'yyyyMMdd'); 
}

Hi, you mix CTL and CTLLite. You transformation should be:

function transform(){
.
.
$0.FILE_NAME:=$0.FILE_NAME;
$0.PERIOD:=str2date('20070101', 'yyyyMMdd'); 
}

“avackova”

It’s working now. So you saying I can not use functions like str2date in easy transformation mapping?
How about parameters? How can I write it down, construction like this doesn’t work:


function transform(){
...
$0.FILE_NAME:=$0.FILE_NAME;
$0.PERIOD:=str2date($par.PERIOD, 'yyyyMMdd');
}


Parameters can be used in standard form: ${param_name} - they are replaced by theirs values during graph instantiation. So in your transformation:

function transform(){
...
$0.FILE_NAME:=$0.FILE_NAME;
$0.PERIOD:=str2date("${PERIOD}", 'yyyyMMdd');
} 

It works :smiley: Thank you!