Hitachi Vantara Pentaho Community Forums
Results 1 to 8 of 8

Thread: filename as a variable

  1. #1
    Join Date
    Oct 2012
    Posts
    116

    Default filename as a variable

    Hello.
    I have a Job with two transformations.
    The first transformations reads the name of the file (inside a specified folder) and as a last step I use "Set Variables" where I set the path of this file as a variable MYPATH.
    The second transformation starts with a Microsoft Access Input in which I set $MYPATH as a input file/directory.

    It does not work. It seems like the variable is not passed to the seconds transformation.

    Where can be a mistake?
    Thanks

  2. #2
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    Make sure you are setting MYPATH, not $MYPATH

    Otherwise, I'd suggest ZIP (NOT RAR) the job, and two transforms together, and post it here - we can usually find a problem like this pretty quickly.
    **THIS IS A SIGNATURE - IT GETS POSTED ON (ALMOST) EVERY POST**
    I'm no expert.
    Take my comments at your own risk.

    PDI user since PDI 3.1
    PDI on Windows 7 & Linux

    Please keep in mind (and this may not apply to this thread):
    No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.
    Signature Updated: 2014-06-30

  3. #3
    Join Date
    Oct 2012
    Posts
    116

    Default

    Thank you.
    Here is it.
    test.zip

  4. #4
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    If $MYPATH fails you, try ${MYPATH}
    So long, and thanks for all the fish.

  5. #5
    Join Date
    Oct 2012
    Posts
    116

    Default

    Thanks, it did not help.
    If you could look on the transformations I uploaded it would be nice.

  6. #6
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Quote Originally Posted by damegu View Post
    Thanks, it did not help.
    It sure did on my machine: The variable is available in your second transformation if you adhere to the correct syntax ${VARNAME} or even %%VARNAME%%

    Quote Originally Posted by damegu View Post
    If you could look on the transformations I uploaded it would be nice.
    So there are other problems you didn't mention?

    You specified a GFN search expression .*\.mdb but packed myfile.accdb - nothing will be found that way.
    BTW: MS Access steps only deal with MDB files.
    So long, and thanks for all the fish.

  7. #7
    Join Date
    Oct 2012
    Posts
    116

    Default

    Quote Originally Posted by marabu View Post

    You specified a GFN search expression .*\.mdb but packed myfile.accdb - nothing will be found that way.
    So stupid mistake Thank you very much. It works now.

  8. #8
    Join Date
    Jun 2012
    Posts
    5,534

    Default

    Quote Originally Posted by marabu View Post
    MS Access steps only deal with MDB files.
    So the Wiki page made me believe, but the other day I found out I had no problem to read from ACCDB with Kettle 4.4.0.

    Quote Originally Posted by Matt Casters in 2008
    This step reads directly from Microsoft Access "MDB" files.
    Seems to be outdated.
    So long, and thanks for all the fish.

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.