Hi,
I wrote a VBScript to manage some files. I need my VBScript to return a value for my Command Prompt stage to capture it if no files can exist.
Later in a Sequence, I will extract the value from the job to decide whether to run the subsequent jobs.
I am not that familiar with how Datastage handles VBScript.
1) How do I write this return value statement in VBScript, is it like like returning a value in the function but I do in in the Main()? Presently I am using Wscript.Quit(valuetoReturn).
2) And what Datastage job can capture this value that is returned and output the value in the job, so that I can conditionally trigger other jobs?
I hope this is clear. Thanks.
VBScript return value to Datastage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
There's no such thing as a Command Prompt stage. Do you mean a Command stage in a job design, or an Execute Command activity in a job sequence.
The mechanism for the latter is to use the activity variable ActivityName.$ReturnValue
With a Command stage - which is executed for every row processed - you simply write the output of the command into a column on the output link.
The mechanism for the latter is to use the activity variable ActivityName.$ReturnValue
With a Command stage - which is executed for every row processed - you simply write the output of the command into a column on the output link.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
1) I have managed to save the returned value, using the Command Stage, to a flat file but what I really need is to throw this value up as a job output.
2) I have been playing with the ExecCommand activity, and though I managed to run my vbscript, and even succeeded in reading my return value (which I chose to be -888) in the log, it doesn't allow me to output it as a condition check. I get the error below:
Would anyone know how I can avoid this and capture this value? By the way, I am using WScript.Quit() to return these values.
2) I have been playing with the ExecCommand activity, and though I managed to run my vbscript, and even succeeded in reading my return value (which I chose to be -888) in the log, it doesn't allow me to output it as a condition check. I get the error below:
The script ran perfectly and I was expecting the -888 value but it records it as an error which I know it's not.14:58:03: Execute_Command_26 finished, reply=-888
14:58:03: Exception raised: @Execute_Command_26, Unhandled failure (-888) encountered executing command cscript /nologo E:\Test\test.vbs "E:\Test\" "E:\Test\TempOutput.txt"
14:58:03: Sequence failed (restartable)
Would anyone know how I can avoid this and capture this value? By the way, I am using WScript.Quit() to return these values.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: