Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: Pan/Kitchen with environmental variables?

  1. #1
    Join Date
    Oct 2008
    Posts
    17

    Default Pan/Kitchen with environmental variables?

    Hi,

    How do you pass in environmental variables into pan/kitchen? When running my transformation in Spoon I can specify the environmental variables (typing them into the GUI) before I run the transformation. How do I do the same in pan, whats the syntax at command-line?

    Thanks
    Tim

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

    Default

    actually via kettle.properties e.g. or you have to "adapt" the executing shell script with -D arguments.

    Regards,
    Sven

  3. #3
    Join Date
    Oct 2008
    Posts
    17

    Default

    Hi,

    Sorry I dont understand either of what you said? via kettle.properties? How would I do it in windows using pan.bat, example?

    Thanks
    Tim

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

    Default

    kettle.properties is the file in the kettle home directory... if you've gotten semi-fixed variables.

    Adding -D's in the pan script e.g. or using other way... you can read e.g. a file using key/value definitions in a "pre"-transformation and set variables like that.

    Regards,
    Sven

  5. #5
    Join Date
    Oct 2008
    Posts
    17

    Default

    Hi,

    I'm still not getting what you mean with the -D? Isn't there just a parameter you can enter like:

    pan.bat /file:"D:\Transformations\Transformation.ktr" -D "Variable1" "Variable2" /level:Basic

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

    Default

    You can try... but the last time I tried that it didn't work yet.

    Regards,
    Sven

  7. #7
    Join Date
    Oct 2008
    Posts
    17

    Default

    Hi,

    Ok so how would you run a transformation in pan with C:\Transformation.ktr with environmental variable exchange = "LCH" and currency = "EUR"?

    Tim

  8. #8
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    Tim, you can pass those variables if you change the .bat/.sh scripts:

    -DLCH=%LCH% for windows
    -DLCH=${LCH} for Linux/OSX/Unix derivates

  9. #9
    Join Date
    Oct 2008
    Posts
    17

    Default

    So I have to edit the pan.bat manually with different variables? I thought I would just be able to pass them into the bat script as arguments?

    The reason I ask is because I want to create a java gui front-end which I type the environmental variables into which then passes them into pan. Is there anyway to do this?

    Tim

  10. #10
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    If you use Java, you really don't need Pan to launch a transformation AND you can indeed inject variables into a transformation as much as you want.
    Look up the Kettle API example on the wiki and the VariableSpace interface.

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.