Dynamic File names

About

Dynamic file naming is a frequent requirement in data processing, and there are multiple ways to achieve it.

Calculations

You can create calculated file names by placing a calculation within curly braces {}.

Example

To include today’s date in a file name dynamically, you can use a calculation as shown below:

C:\Data\{GetSystemDate('YYYYMMDD')}.txt

and that one will use yesterdays date

C:\Data\{DecDateS(GetSystemDate('YYYYMMDD'),'YYYYMMDD','DAY',1)}.txt
Dynamic file names

Variables

<CommonDocumentsDir>\DBSL\{GetSystemVariable('SOURCE_FILE_NAME')}.txt
<CommonDocumentsDir> is a variable and will be replaced with an actual value before execution
C:\Data\{GetVariable('<file_name>')}.txt

More complex example

This calculation will create a new file every time [F001] is changed

Dynamic Filenames

Script

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

Posted on November 14, 2025 • 1 min read • 204 words
www.etl-tools.com About Support Pricing Cookies Policy Term Of Use Privacy Policy License