Using JOB parameters in Email Notification Activity Stage

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
dwscblr
Participant
Posts: 19
Joined: Tue May 18, 2004 12:39 am

Using JOB parameters in Email Notification Activity Stage

Post by dwscblr »

Hi

How can I use JOB parameters in the Email notification activity stage.
I do not want to hardcode the Recepients Email address in the mail notification activity stage.

Thanks
Sreeja
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Upgrade to 7.5 - that's the first time that parameters are supported in that stage.

What we do is "hard code" email notification groups there. That way we can change who gets the emails without having to touch the jobs.

Or... write your own email routine. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

Post by tonystark622 »

We use the Routine Activity stage and call a shell script to send the email. The Routine Activity stage supports Job Parameters, but you have to key them in manually, there's no expression builder for this.

FYI, the shell script is a wrapper around the UNIX sendmail command.

Tony
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

I'm pretty sure that I've used job parameters in the email notification activity successfully in both versions 6.0 and 7.1. I can't check at the moment to see how I got it to work. I seem to recall that it didn't follow the usual enclosing within #'s. I think I used the parameter as emailSendTo instead of #emailSendTo#.

Mike
tonystark622
Premium Member
Premium Member
Posts: 483
Joined: Thu Jun 12, 2003 4:47 pm
Location: St. Louis, Missouri USA

Post by tonystark622 »

I just tested this in v7.1.0 and it didn't work.

I had a Job Parameter called SendToEmailAddy. I put this in the Recipients email address. It sent an email to SendToEmailAddy, not to the email addy in the Job Parameter SendToEmailAddy.

Tony
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Nope, never been there. From the readme for 7.5:

Code: Select all

Job Sequencer 
-------------
A number of enhancements have been made to the Job Sequencer at this
release:

- Additions to Notify Stage
  The Notification Activity can now send attachments. Multiple attachments
  are also supported. All fields may include parameters, except the email
  body.
Unfortunately, it looks like they still haven't added that same ability to the Command Execution stage. :cry: But then I haven't tried it yet...
-craig

"You can never have too many knives" -- Logan Nine Fingers
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

The general consensus seems to be that it doesn't work. I was blissfully unaware since I have only tried it on two installations and it has worked on both. I'm positive that I used a job parameter for the email recipient (there is no way that I am going to hard-code my email address into the notification activity stage). I still have access to both installations and can get the details of my sequence job designs tomorrow.

Mike
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You know, sitting here and thinking about it... you may be right. From previous conversations here or on ADN, I think that it did work - but only on one specific platform and that probably by accident. :wink:

What they've finally done is address the issue and made it work across all platforms in the manner you've always assumed it should work.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

I went back and checked out our email notification setup. As it turns out, we never actually got it working with job parameters in our 6.0 installation.

However, it is working in our 7.1 installation on a Solaris 8 server. We created a job parameter called $emailSendTo as a user-defined environment variable via the administrator client. Within the email notification stage, the recipient address is set to $emailSendTo (no enclosing #'s). At run time, we set the job parameter's value to $PROJDEF. The director log indicates that the email was sent to '$emailSendTo' as if no value substitution occurred, but the email actually goes through just fine.

Glad to hear it is working normally in 7.5. With the quirky behavior observed in our 7.1 installation, I can readily believe that it is purely accidental that it works on the Solaris 8 platform.

Mike
alokkum
Participant
Posts: 8
Joined: Tue Aug 03, 2004 7:16 pm

Post by alokkum »

Put proper parameters what you do in jobs, the same way, and compile the sequence. copy the sequence compiled code and paste it in a new server job control script, check for '# #' in the code and remove it manually. Then compile that new server job. and instead of running the sequencer, run this new server job. Hope this helps.
Thanks
Alok
ketfos
Participant
Posts: 562
Joined: Mon May 03, 2004 8:58 pm
Location: san francisco
Contact:

Post by ketfos »

Hi,
Pass these values as parameters in Notification Activity Stage in DS 7.5
and it works

Ketfos
Post Reply