Passing Parameter to start loop activity in the sequence

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
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Passing Parameter to start loop activity in the sequence

Post by g_rkrish »

hi,

I need to pass a set of email address as a start loop activity in the Job sequence.when i tried giving as paramter by giving the file name as parameter i didn't work.any suggesstion on that.

thanks,
RK
RK
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Re: Passing Parameter to start loop activity in the sequence

Post by kwwilliams »

Is the list of email addresses that you need to send dynamic? If it is not dynamic you could set up an environmental variable.

If it is dynamic you are going to need to create a routine that reads the file, and returns all of the emails as one output column. You could then send this output to the start loop activity.

Was the loop meant to read the file or were you doing something else?
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Re: Passing Parameter to start loop activity in the sequence

Post by g_rkrish »

kwwilliams wrote:Is the list of email addresses that you need to send dynamic? If it is not dynamic you could set up an environmental variable.

If it is dynamic you are going to need to create a routine that reads the file, and returns all of the emails as one output column. You could then send this output to the start loop activity.

Was the loop meant to read the file or were you doing something else?
Actually i am sending the email address as dynamic.aslo if you can help me out with setting up with environment variable would be great.I am sending the notification as part of the automation activity to report the status of the job.

Thanks,
RK
RK
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Re: Passing Parameter to start loop activity in the sequence

Post by kwwilliams »

How dynamic, it changes with each job run? Or it can change occasionally?
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Re: Passing Parameter to start loop activity in the sequence

Post by g_rkrish »

kwwilliams wrote:How dynamic, it changes with each job run? Or it can change occasionally?
it will chage occasionaly.also that is not the key thing we can make it static also.only problem is i want to send it as file.(to address)
RK
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Re: Passing Parameter to start loop activity in the sequence

Post by kwwilliams »

I just want to make sure I understand you correctly.

One of the following is true:

1. The file contains the email addresses that you need to send the notification to.

or

2. The file is to be sent to the users in the to address.

If 1 is true I would also like to know why you want to set this up through a file. Have you looked at using environmental variables instead?

Really looking for clarification before I start providing answers.
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Re: Passing Parameter to start loop activity in the sequence

Post by g_rkrish »

kwwilliams wrote:I just want to make sure I understand you correctly.

One of the following is true:

1. The file contains the email addresses that you need to send the notification to.

or

2. The file is to be sent to the users in the to address.

If 1 is true I would also like to know why you want to set this up through a file. Have you looked at using environmental variables instead?

Really looking for clarification before I start providing answers.
1 is true.i have n't beacuse the file contents change over a period of time.
also if you can suggest me on the environment variable if you guide me on that i will appreciate that.
RK
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Re: Passing Parameter to start loop activity in the sequence

Post by g_rkrish »

kwwilliams wrote:How dynamic, it changes with each job run? Or it can change occasionally?

not each job ru.Occasionaly it will change.
RK
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Re: Passing Parameter to start loop activity in the sequence

Post by kwwilliams »

Go into Data Stage Administrator and then set up a variable name, something like STEWARDEMAIL. Provide a description, and set the type to string. Make the email address be whatever email you were going to put in the file.

Then go to your job properties and include this environmental variable in your job properties.

What version of dataStage are you running?
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Re: Passing Parameter to start loop activity in the sequence

Post by g_rkrish »

kwwilliams wrote:Go into Data Stage Administrator and then set up a variable name, something like STEWARDEMAIL. Provide a description, and set the type to string. Make the email address be whatever email you were going to put in the file.

Then go to your job properties and include this environmental variable in your job properties.

What version of dataStage are you running?
my version is 7.5
RK
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Re: Passing Parameter to start loop activity in the sequence

Post by kwwilliams »

Cool. Set up your environmental variable in the administrator. Add the environmental variable into the properties of your job and then set the value equal to $PROJDEF. Anytime you need to change the value you just go into the administrator and change the value there and it will automatically be picked up in the sequence.
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Re: Passing Parameter to start loop activity in the sequence

Post by g_rkrish »

kwwilliams wrote:Cool. Set up your environmental variable in the administrator. Add the environmental variable into the properties of your job and then set the value equal to $PROJDEF. Anytime you need to change the value you just go into the administrator and change the value there and it will automatically be picked up in the sequence.
so the environment variable should have the defalut value as file name?or can you explain me bit in detail.
RK
kwwilliams
Participant
Posts: 437
Joined: Fri Oct 21, 2005 10:00 pm

Re: Passing Parameter to start loop activity in the sequence

Post by kwwilliams »

It sounds like you are using the filename to actually store the email address. This seems a bit of an overkill. Why not just have it stored as an environmental variable and when it changes it is changed in the administrator. Thsi would only be pleasant if it changes ocasionally and not often.

What creates your file and populates it? In other words what is the triggering mechanism for an email change?
parag.s.27
Participant
Posts: 221
Joined: Fri Feb 17, 2006 3:38 am
Location: India
Contact:

Re: Passing Parameter to start loop activity in the sequence

Post by parag.s.27 »

g_rkrish wrote:hi,

I need to pass a set of email address as a start loop activity in the Job sequence.when i tried giving as paramter by giving the file name as parameter i didn't work.any suggesstion on that.

thanks,
RK
you can simply add a user variable stage in the starting of your sequence. In that user variable stage you can defin required parameters. the output of that stage can now be fed to the Job Activity stage where you can give this value to the parameter that you might have defined in the job tab.

so if you want email as parameter, then
define a user variable Email
Define Email as a parameter in that job tab and in its value expression just provide that variable as USER_VARIABLES.Email
Thanks & Regards
Parag Saundattikar
Certified for Infosphere DataStage v8.0
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Re: Passing Parameter to start loop activity in the sequence

Post by g_rkrish »

kwwilliams wrote:It sounds like you are using the filename to actually store the email address. This seems a bit of an overkill. Why not just have it stored as an environmental variable and when it changes it is changed in the administrator. Thsi would only be pleasant if it changes ocasionally and not often.

What creates your file and populates it? In other words what is the triggering mechanism for an email change?
let me explain bit clear

what i have done i have a module in which i have created a env variable as you explained.i am using that in the sequence in sending email but when i inlcude the job info there is none of the info included.i will do the multiple email as you said but can you help me out with this issue.
RK
Post Reply