Dynamic file naming is a frequent requirement in data processing, and there are multiple ways to achieve it.
You can create calculated file names by placing a calculation within curly braces {}.
To include today’s date in a file name dynamically, you can use a calculation as shown below:
C:\Data\{GetSystemDate('YYYYMMDD')}.txtand that one will use yesterdays date
C:\Data\{DecDateS(GetSystemDate('YYYYMMDD'),'YYYYMMDD','DAY',1)}.txt
<CommonDocumentsDir>\DBSL\{GetSystemVariable('SOURCE_FILE_NAME')}.txt<CommonDocumentsDir> is a variable and will be replaced with an actual value before executionC:\Data\{GetVariable('<file_name>')}.txtThis calculation will create a new file every time [F001] is changed
begin
if GetVariable('<file_name>')<>[F001] then // record changed
begin
SetVariable('<file_name>',[F001]);
SourceChanged; // creating new file
end;
Result:='test';
end;For more technologies supported by our ETL Software see Advanced ETL Processor Versions
Confused? Ask question on our ETL Forum