informaticainformatica-powercenterinformatica-cloudiics

How to generate flatfile with zero records when there are no records in source?


I'm doing incremental data load from relatioal db to dynamically created flat file. Suppose if there are no new records in source the mapping not creating target file. I need a empty Target file if there are no records fetched From source


Solution

  • You can create a cmd task which will kick off on a condition.

    1. in cmd task just put this command
    touch /location/empty_file.txt
    
    1. Link main session to this command task. Double click on link and add below condition to link.
    $yourMainSessionName.SrcSuccessRows = 0
    

    So, this command task will activate only when your main session pulls 0 rows.