Detecting files with a variable name
Detecting files is actually a fairly trivial operation in ODI, but we have noticed that many people either do not know how to do it or even don't know that it is possible using ODI. Since detection is so simple, we will use this recipe to prepare the ground for the next two recipes.
Getting ready
For this recipe, we will detect when files are added to the c:\temp
directory. Make sure that you have an instance of your file explorer ready. Create a directory c:\temp\landing
and create three files in that directory: EMP001.TXT
, EMP002.TXT
, and EMP003.TXT
. There is no need for any content in the files for this recipe. As part of this recipe, we will copy all three files into the c:\temp
directory.
How to do it...
Create a new variable called
FILE_SIGNATURE
. Define that variable asAlphanumeric
, and keep the latest value for the variable. There is no need for a default value or refresh statement.Create a new package and call it
Detect Files
. Drag-and-drop the...