If you go this route... no, that command would not be correct. You echo the contents of the file and then as you correctly noted, use the result in the Trigger Expression. So this if your path is hard-coded:
Ok, this seems like it should be straight forward, but I'm not getting the results I anticipate.
My file has three simple records:
1855
265
"Y"
I have an Execute Command activity in my sequence. The ExecCommand tab has the following on the Command line.
echo /path/path/filename.TXT
The triggers tab of the Execute Command stage has a Custom -(Conditional) expression type with the following as an expression.
stagename.$CommandOutput<3>='Y'
When I view the job log, the Execute Command activity has the correct path and file name, starts, then finishes with reply=0, then the entire sequence finishes.
If you are on Windows, change the 'echo' to a 'type'. Right now it's probably just echoing the string that is the name of your file rather than the contents. On UNIX you would use 'cat', on Windows the equivalent is 'type'.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Ok, 'type' looks to be correct, but now it's not finding the file. I'm sure it never was. I'm getting:
Output from command ====>
sh: line 0: type: /path/path/filename.TXT: not found
The structure '/path/path/filename.TXT' is what I use in my DS jobs and they write the files to the correct location. Being a sequence and not a job, I wonder if I need an additional path level in the ExecCommand? I suppose I'll have to play with this.
You may need to include the drive letter if the files are on a different drive from where the DataStage jobs are executing. Otherwise a path is a path is a path and the Execute Command stage doesn't treat them as anything different from what the Sequential File stage would in a job.
-craig
"You can never have too many knives" -- Logan Nine Fingers