Dynamic Notification_Activity

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

abha_sinha
Participant
Posts: 8
Joined: Mon Apr 13, 2009 5:01 am
Location: KOLKATA

Dynamic Notification_Activity

Post by abha_sinha »

Hi
I want to add the list of recepient address from a text file.
Can you please tell me how can i do this.Also, i would like to know if it is possible to attach all the files(No.,Name unknown before run-time) of a folder as attachment.
Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Welcome. :D

For the "list of recipients" from a text file, you'd need something (a routine perhaps) to "read" the file and return the contents of it in a properly delimited list. Load that into a job parameter and use that parameter in the "To:" portion of Notification Activity stage. Me, I find using "notification groups" a much better solution. You can still parameterize the group name, but it means a single "To:" entity that your email system then manages. And changes to the distribution list are then a simple change in the email system, which is where things like that should be maintained. IMHO.

There's no automated way to attach all files from a directory to an email. You could script something to do that and then run the script, or what I would do is zip all of the files up into a single archive and then attach / send that single archive in the email. Much cleaner. Again, IMHO. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
abha_sinha
Participant
Posts: 8
Joined: Mon Apr 13, 2009 5:01 am
Location: KOLKATA

Post by abha_sinha »

Hi Craig
Thanks for your reply :) Can you please tell me if there is any way to create Notification Group in datastage?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No, you do that in the email system. Create an address that is a list address, and have DataStage send to that.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dh_Madhu
Premium Member
Premium Member
Posts: 65
Joined: Sat Apr 23, 2005 3:19 am
Location: Stirling, Scotland

Post by dh_Madhu »

I have a list of email addresses in a file. I retrieve the nth row of the file and wish to pass this extract as a parameter in the notification stage. But I get an error stating thus "Parameter 2 ('') does not start with a keyword"...any idea what it means!!

thanks
Regards,
Madhu Dharmapuri
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You'll need to retrieve it and pass it as a Job Parameter to the Sequence job with the Notification Activity stage in it, is that what you are trying to do?
-craig

"You can never have too many knives" -- Logan Nine Fingers
dh_Madhu
Premium Member
Premium Member
Posts: 65
Joined: Sat Apr 23, 2005 3:19 am
Location: Stirling, Scotland

Post by dh_Madhu »

exactly!
I am taking that particular row and have tried putting it in another file so as to have one single line in it and am doing a 'cat' of that file. The command output is now passed as a parameter to the notification stage..but still couldnt make it :(
Regards,
Madhu Dharmapuri
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Just to make sure that we're on the same page, are you doing the 'cat' outside of the Sequence job that does the Notification? So you can then pass those values in a Job Parameters to the Sequence job and then use those job parameters in the notification stage?

If you are doing this all in the same job, you'll need to look into referencing the $CommandOutput variable of the 'cat' statge, assuming you are using an Execute Command stage for that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dh_Madhu
Premium Member
Premium Member
Posts: 65
Joined: Sat Apr 23, 2005 3:19 am
Location: Stirling, Scotland

Post by dh_Madhu »

Yes you are right. Iam doing all this in the same sequencer job and am using the Excecute command stage for this.
thanks
Regards,
Madhu Dharmapuri
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then there are no parameters involved and you need to use $CommandOutput as noted above.

Code: Select all

#Execute_Command_Stage_Name.$CommandOutput#
-craig

"You can never have too many knives" -- Logan Nine Fingers
dh_Madhu
Premium Member
Premium Member
Posts: 65
Joined: Sat Apr 23, 2005 3:19 am
Location: Stirling, Scotland

Post by dh_Madhu »

Yes, thats what I have done... and I get this error :shock:
btw, it's a comma seperated list....is that one to do with it?
thanks
Regards,
Madhu Dharmapuri
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First try it with a single address and see if that works, then go from there. What you need between them depends on your mail server, so experiment - comma, space, comma space, semicolon, who knows?
-craig

"You can never have too many knives" -- Logan Nine Fingers
dh_Madhu
Premium Member
Premium Member
Posts: 65
Joined: Sat Apr 23, 2005 3:19 am
Location: Stirling, Scotland

Post by dh_Madhu »

Thanks Craig, I have already tried with a single address but shall try different combinations as you said......thanks again.
Regards,
Madhu Dharmapuri
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Note that you need to remove field marks identified as @FM from the command output.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You tried with with a single address and... did it work that way? Trying to understand if you can't get it to work at all or if the issue is only with multiple email addresses. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply