Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: How to generate dynamic output file names based on result set from previous job.

  1. #1
    Join Date
    Jun 2006
    Posts
    282

    Cool How to generate dynamic output file names based on result set from previous job.

    I'm having a difficult time with this one. Shouldn't I be able to pass a result set from say Job1 where in Job1 I have a trans that generates one column output of say 2010-01-01, 2010-02-01 etc and use each value as I iterate in Job2? For each iteration I want to use that value to specify the file name in my serialize to file step.
    "If you want to increase your success rate, double your failure rate."
    Thomas Watson, Sr (former president of IBM)

  2. #2
    Join Date
    Sep 2007
    Posts
    834

    Default

    The Serialize to file needs the filename as a variable. So you could define it as a named parameter (both in the transformation and in the Job 2; I guess that from Job 2 you call a transformation that serializes to file.)

    In the first transformation create a field with the name of the file (full path) and add a copy rows to result.
    In the job entry for the second job check Execute for every input row and Copy previous results to parameters.
    Finally, in the Parameters tab add a parameter: as Parameter type the name of your named parameter, as Stream column name type the name of the field that contains the name of the file.
    It should work.
    btw: this topic is fully explained in Chapter 7 of Pentaho Data Integration 4 Cookbook.

  3. #3
    Join Date
    Jun 2006
    Posts
    282

    Thumbs up Got it working!!

    Maria -
    Thank you so much. I forgot to add the named parameter in the job itself. Works like a charm. I'll be sure to grab a copy of your cookbook.

    Cheers!!!
    Darrin
    "If you want to increase your success rate, double your failure rate."
    Thomas Watson, Sr (former president of IBM)

  4. #4
    Join Date
    Mar 2010
    Posts
    159

    Default

    Congrats on your book release Maria!

    Regards,
    Jeremy

  5. #5
    Join Date
    Sep 2007
    Posts
    834

    Default

    Thanks, Darrin. Nice to hear that it worked.
    Thanks, Jeremy!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.