Parameter Setting and Accessing

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
mimran
Participant
Posts: 7
Joined: Wed Nov 05, 2003 2:56 pm

Parameter Setting and Accessing

Post by mimran »

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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by 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: Select all

echo $MyValue > $filename

`head -1 $filename`
The two commands run in separate processes, so don't have access to any form of shared variable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
mimran
Participant
Posts: 7
Joined: Wed Nov 05, 2003 2:56 pm

Post by mimran »

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]
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by 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 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.
mimran
Participant
Posts: 7
Joined: Wed Nov 05, 2003 2:56 pm

Post by mimran »

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]
Post Reply