Page 1 of 1

Check existence of a file from a Transformer

Posted: Wed Mar 21, 2007 8:46 am
by ag_ram
Hey Folks

Is it possible to find if a file exists from a transformer stage ..can we have a constraint defined based on the existence and non existence of a file

Posted: Wed Mar 21, 2007 9:01 am
by DSguru2B
Sure you can. You need to write a routine that checks for file existence and returns an appropriate return value which you can then check inside the transformer and proceed. I wrote a simple one months back. Search for it here.

Posted: Wed Mar 21, 2007 9:01 am
by ganesh123
I guess its possible from TX but you can check the existence of input file by using before job subroutine "DSWaitForFile"

Posted: Wed Mar 21, 2007 9:04 am
by ag_ram
DSguru2B wrote:Sure you can. You need to write a routine that checks for file existence and returns an appropriate return value which you can then check inside the transformer and proceed. I wrote a simple one months back. Search for it here.
Any keywords that i have to look for search ..

Posted: Wed Mar 21, 2007 9:12 am
by DSguru2B
I could'nt find mine, and dont have time to search for more, Ray has a similar routine to do the same. Click here.

Posted: Wed Mar 21, 2007 9:19 am
by chulett
You sure you want to do that in a transformer? Once for every row processed by the job?

Use the 'Initial Value' area of a Stage Variable to do that if you only need to check once, then leverage that variable in the constraint for the job run.