Table of Contents

Search

  1. Preface
  2. Transformations
  3. Source transformation
  4. Target transformation
  5. Access Policy transformation
  6. Aggregator transformation
  7. B2B transformation
  8. Cleanse transformation
  9. Data Masking transformation
  10. Data Services transformation
  11. Deduplicate transformation
  12. Expression transformation
  13. Filter transformation
  14. Hierarchy Builder transformation
  15. Hierarchy Parser transformation
  16. Hierarchy Processor transformation
  17. Input transformation
  18. Java transformation
  19. Java transformation API reference
  20. Joiner transformation
  21. Labeler transformation
  22. Lookup transformation
  23. Machine Learning transformation
  24. Mapplet transformation
  25. Normalizer transformation
  26. Output transformation
  27. Parse transformation
  28. Python transformation
  29. Rank transformation
  30. Router transformation
  31. Rule Specification transformation
  32. Sequence transformation
  33. Sorter transformation
  34. SQL transformation
  35. Structure Parser transformation
  36. Transaction Control transformation
  37. Union transformation
  38. Velocity transformation
  39. Verifier transformation
  40. Web Services transformation

Transformations

Transformations

Flat file targets with dynamic file names

Flat file targets with dynamic file names

If you create a flat file target at run time, you can specify a dynamic file name. A dynamic file name uses an expression to generate the file name.
You can use a dynamic file name to create a new target file every time the
mapping
task runs. For example, the following expression creates a file called "OrdersOut_<system_timestamp_with_second_precision>.csv" each time the
mapping
task runs:
'OrdersOut_'||To_Char(SYSDATE, 'YYYYMMDDHH24MISS')||'.csv'
You can also use a dynamic file name in a mapping that contains a Transaction Control transformation to write data to a different target file each time a transaction boundary changes. For example, the following expression can be used in a target that is downstream of the Transaction Control transformation to commit data to a different target file every time the DEPT_ID field changes:
'Results_Dept_'||To_Char(DEPT_ID)||'.dat'
To specify a dynamic file name, in the
Target Object
dialog box, select
Use a Dynamic File Name
and enter the file name expression in the expression editor.
The following image shows the
Target Object
dialog box with the
Use a Dynamic File Name
option enabled:
The image shows the Target Object dialog box for a flat file target. The "Create New at Runtime" option is selected and the "Use a Dynamic File Name" check box is checked. Because a dynamic file name is selected, the expression editor appears in the dialog box. The expression 'Results_Dept_'||To_Char(DEPT_ID)||'.dat' is entered in the expression editor.
You can include incoming field names, constants, operators, built-in functions, and user-defined functions in the target file name expression.
If you use an incoming field name in the file name expression, you can choose to exclude the field from the target. When you enable the
Exclude Dynamic File Name Field
option,
Data Integration
does not write the incoming field used in the expression to the target. Include only one incoming field in the expression. If you include more than one incoming field, the expression is invalid.
To use more than one incoming field, add an Expression transformation directly before the Target transformation. In the Expression transformation, configure a field to hold the expression that you want to use as the file name. In the Target transformation, use this field as the expression in the dynamic file name.
For more information about creating expressions, see the
Function Reference
.

0 COMMENTS

We’d like to hear from you!
Matthew Linker - October 30, 2023

This option doesn't work when trying to write to S3, I've searched high and low and there appears to be no easy way to do this. The "Use Dynamic File Name" option is not visible. 

Informatica Documentation Team - October 30, 2023

Hi Matthew Linker,

Thanks for reaching out! We'll check with our development and QA teams about this and get back to you.


Informatica Documentation Team - October 31, 2023

Hi Matthew Linker,

Our QA team confirmed that this option is only available for flat file types, and not for Amazon S3 files.

To implement dynamic file names in Amazon S3, you can use parameterization as described in the "Amazon S3 V2 parameterization" topic and its child topics in the Amazon S3 V2 Connector guide.