1 Reply Latest reply on Mar 31, 2020 10:33 PM by Syed Aziz

    Transaction Control Transformation file generation issue

    Divya Gopalakrishnan Nair New Member

      I have a mapping in which, I read a set of transactions from Oracle DB, pass it to an Expression transformation(I assign a file name with format filename_<key>.txt), and then to a Transaction Control transformation to generate a file per transaction. But for some transactions, half of the file is written to one file and the second half in another file. This is not supposed to happen. This happens in PROD. I tried passing the same transaction in DEV, where the file is getting generated properly. I suspect it to be some configuration issue. Anybody faced this issue before? Please help

        • 1. Re: Transaction Control Transformation file generation issue
          Syed Aziz Guru

          Hello Divya,

           

          To create a flat-file for each set of data rows within the same session, you can use the FileName port. These data rows can be grouped into different sets by issuing commits or real-time flushes.
          This grouping of data is based on a port (column), for which a button (Add filename column to this table) is added on the flat file target.

          To add a new port, do the following:

          1. In the Designer, select the Target Definition.
          2. Edit the Target Definition.
          3. Click the Columns tab in the Edit Tables window, click on the Add filename column to this table icon.
             
          4. You can provide the file names for different sets of data rows by connecting to FileName port in Designer.
          More Information
          Another way (Workaround)
          1. In the pre-session command create a temp directory under $PMTargetFileDir.
          2. Set the target folder path as $PMTargetFileDir/temp.
          3. Execute a script in the post-session success command to redirect the ls command to a flat-file.
            Now all the target files and the file list file will be in the temp folder.
          4. Move all these files to TgtFiles folder.
          5. At the end of the script, remove the temp folder.

           

          Best regards,

          Syed

          1 of 1 people found this helpful