Forum Stats

  • 3,827,947 Users
  • 2,260,843 Discussions
  • 7,897,410 Comments

Discussions

Check file exist and start mapping

User_84SZK
User_84SZK Member Posts: 37 Red Ribbon

Hello everyone, is it possible to check whether a file exists in the loading plan using the variables or CASE WHEN conditions?

Then I would like to start a mapping if the file is available.


Currently I'm running the mapping which takes the file and imports it( in exception mode - throw no error). But I would like to have the exception so that the loading plan breaks off at the beginning if the data is corrupt.


I would like to do this in the loading plan, since it is possible to see the inserted data records here. Is this possible and if so how?

Tagged:

Best Answer

  • Rodrigo Radtke Souza
    Rodrigo Radtke Souza Member Posts: 212 Gold Badge
    Answer ✓

    Since you have multiple files and they are independent of each other, I would probably create a package for each mapping with something similar to this:

    If the file is not there, it goes to dummy step, but does not log as an error (the step is still an error, but the overal package is not):

    If the file exists, it goes to the mapping.

    I hope it helps.

    User_84SZK

Answers

  • Rodrigo Radtke Souza
    Rodrigo Radtke Souza Member Posts: 212 Gold Badge

    I would probably try to add OdiFileWait object in a scenario and set it to throw an error if the file is not found:

    Then I would put it in the Load Plan as the first step and set an exception if you want to handle it (or maybe just leave it as an error).

    Hope it helps.

  • User_84SZK
    User_84SZK Member Posts: 37 Red Ribbon

    Hello and thank you for yourfeedback.

    Unfortunately I have a different use case. In my loadplan, I load different files into a different stage tables one after the other. Here it can happen that one of these files was not delivered. Nevertheless, it should continue to be loaded.

    I've set the exception to Ignore, but I don't like these solutions very much, because the operator still logs an error and the logs fill up. With daily loading, this becomes confusing.


    Is it possible not to log this or should I implement it in antoher way?

    What is the best practise for this?

  • Rodrigo Radtke Souza
    Rodrigo Radtke Souza Member Posts: 212 Gold Badge
    Answer ✓

    Since you have multiple files and they are independent of each other, I would probably create a package for each mapping with something similar to this:

    If the file is not there, it goes to dummy step, but does not log as an error (the step is still an error, but the overal package is not):

    If the file exists, it goes to the mapping.

    I hope it helps.

    User_84SZK