Hi,
In a Job Sequence, i would like to set a parameter through an external command in an Execute Command Stage. Then pass the same parameter to the next stage which can be another Execute Command stage.
Can i do this? If yes then how?
Thanks in advance.
Parameter Setting and Accessing
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Depends on what your commands are.
Probably the easiest thing to do, if your commands are shell scripts, is to write the value to a file in the one, and read it from the same file in the other.
For example:
The two commands run in separate processes, so don't have access to any form of shared variable.
Probably the easiest thing to do, if your commands are shell scripts, is to write the value to a file in the one, and read it from the same file in the other.
For example:
Code: Select all
echo $MyValue > $filename
`head -1 $filename`
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.
Thanks Ray,
Yes I'm using shell script and doing the same thing as you said, but wanted to avoid creating another file by setting the parameters within datastage if possible.
Thanks again.
[quote="ray.wurlod"]Depends on what your commands are.
Probably the easiest thing to do, if your commands are shell scripts, is to write the value to a file in the one, and read it from the same file in the other.
For example:
[code]echo $MyValue > $filename
`head -1 $filename`[/code]
The two commands run in separate processes, so don't have access to any form of shared variable.[/quote]
Yes I'm using shell script and doing the same thing as you said, but wanted to avoid creating another file by setting the parameters within datastage if possible.
Thanks again.
[quote="ray.wurlod"]Depends on what your commands are.
Probably the easiest thing to do, if your commands are shell scripts, is to write the value to a file in the one, and read it from the same file in the other.
For example:
[code]echo $MyValue > $filename
`head -1 $filename`[/code]
The two commands run in separate processes, so don't have access to any form of shared variable.[/quote]
Also be aware that both the Execute Command and Notification Activity stages do not accept Job Parameters. So, if that's what you meant by 'parameters', you'll have to explore another option - like writing Routines to wrapper what you need to call.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The two Commands run in separate process. And, if I read your original requirement correctly, one after the other.
If they ran concurrently, there may be some capacity for creating IPC routines for communication between them.
But, without that, there's no common environment. You have to use the file system.
If they ran concurrently, there may be some capacity for creating IPC routines for communication between them.
But, without that, there's no common environment. You have to use the file system.
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.
Thanks a lot Ray,
I found the work around using shell script itself. I'm able to manage the parameter value with one single shell script and don't have to write another shell script as i mentioned in my first post.
Thanks again
[quote="ray.wurlod"]The two Commands run in separate process. And, if I read your original requirement correctly, one after the other.
If they ran concurrently, there may be some capacity for creating IPC routines for communication between them.
But, without that, there's no common environment. You [u]have[/u] to use the file system.[/quote]
I found the work around using shell script itself. I'm able to manage the parameter value with one single shell script and don't have to write another shell script as i mentioned in my first post.
Thanks again
[quote="ray.wurlod"]The two Commands run in separate process. And, if I read your original requirement correctly, one after the other.
If they ran concurrently, there may be some capacity for creating IPC routines for communication between them.
But, without that, there's no common environment. You [u]have[/u] to use the file system.[/quote]