Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: Passing variables through jobs

  1. #1

    Default Passing variables through jobs

    Hi guys,

    I'm having trouble passing variable between jobs, and was hoping for some clarification.

    I have ( for the scope of this problem) A job (MASTERJOB) and two transformations (TRANSA, TRANSB) that run from that job.

    MASTERJOB is set to execute for each row. At the end of TRANSA, I set a variable (%%PresentationDBNAME%%) with the scope of Parent Job.

    TRANSB then runs, and has an oracle DB connection determined by this variable.

    I've refer to the variable using $(PresentationDBNAME) and %%PresentationDBNAME%% and neither have worked.

    I've tried using a get Variable step, with the variable name as both listed above, and outputting to a text document. All that is output is the literral string I entered - "%%PresentationDBNAME%%".

    Is there something I'm missing? I thought a variable declared in the scope of a job was available for its children (TRANSB in this case).

    Any help would be greatly appreciated.

    Josh

  2. #2
    Join Date
    May 2006
    Posts
    4,882

    Default

    Your general idea is right (when using >= v3.x) ... however not all parts of PDI are variable sensitive. Did you use it in a field ended by a gray diamond with $ on it?

    For get variable step don't use %% or %{}... just the name

    Regards,
    Sven

  3. #3

    Default

    For the Get variable step, I took out the surrounding %%, and now the text file just writes "PresentationsDBNAME" to the file.

    In the database connection, I'm using $(PresentationsDBNAME) in the host and database name fields, which allow variables.

    When the transformation runs, the DB connections through IO NL errors.

    3.0.4 PDI

  4. #4
    Join Date
    May 2006
    Posts
    4,882

    Default

    ${} not $() ... ACCOLADES

    S.
    Last edited by sboden; 08-27-2008 at 11:26 AM.

  5. #5

    Default

    Haha, cheers mate. I feel like an idiot now.

    Thanks for your quick replies. I'm no longer at work, but when I return I'll check that that's it (I'm pretty sure it is).

  6. #6
    Join Date
    Sep 2007
    Posts
    834

    Default

    Wouldn't it be ${} ?

    Quote Originally Posted by sboden View Post
    %{} not %() ... ACCOLADES

    S.

  7. #7
    Join Date
    May 2006
    Posts
    4,882

    Default

    Of course

  8. #8

    Default

    Thanks for the help, everything is working perfectly now.
    Last edited by JBarclay; 08-27-2008 at 07:48 PM.

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.