Branching Code without Raising Director Warnings
Posted: Thu Sep 15, 2005 8:54 am
I have a Job Sequence that creates approx 500 data files (one at a time inside a loop).
After each file is created I run an awk command in a Routine to check the contents of the file. If the file has certain data then I write debug info out to another file - this is the case in about 1 in 5 files.
If the debug file is created then I want my Job Sequence to follow a different path. To do this I have tried using an 'ls' command inside an Execute Command Activity and have also used a Wait For File Activity - these both work fine and do what I want EXCEPT that when the debug file is not found a warning message is written to the Director log. When running a datastage job from the command line my process crashes after 50 warnings (as covered in other posts).
What can I do to branch my code on the existence of a file without a warning being written to Director when it isn't found ? If I pass anything other than 0 out of a Routine I get a warning written to Director log - that would be the simple option.
I even tried 'touch'ing the debug file to get an empty entry and then using 'sum filename' in an Execute Command Activity and writing a custom trigger to check the left most part of the return <> 0 for branching the code but this didn't work.
I feel that I am missing something really simple here and would appreciate any pointers.
After each file is created I run an awk command in a Routine to check the contents of the file. If the file has certain data then I write debug info out to another file - this is the case in about 1 in 5 files.
If the debug file is created then I want my Job Sequence to follow a different path. To do this I have tried using an 'ls' command inside an Execute Command Activity and have also used a Wait For File Activity - these both work fine and do what I want EXCEPT that when the debug file is not found a warning message is written to the Director log. When running a datastage job from the command line my process crashes after 50 warnings (as covered in other posts).
What can I do to branch my code on the existence of a file without a warning being written to Director when it isn't found ? If I pass anything other than 0 out of a Routine I get a warning written to Director log - that would be the simple option.
I even tried 'touch'ing the debug file to get an empty entry and then using 'sum filename' in an Execute Command Activity and writing a custom trigger to check the left most part of the return <> 0 for branching the code but this didn't work.
I feel that I am missing something really simple here and would appreciate any pointers.