Page 1 of 2

Dynamic Notification_Activity

Posted: Tue Apr 14, 2009 7:02 am
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

Posted: Tue Apr 14, 2009 8:00 am
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:

Posted: Thu Apr 16, 2009 12:23 am
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?

Posted: Thu Apr 16, 2009 12:57 am
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.

Posted: Tue Jul 07, 2009 8:35 am
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

Posted: Tue Jul 07, 2009 9:11 am
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?

Posted: Tue Jul 07, 2009 9:20 am
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 :(

Posted: Tue Jul 07, 2009 11:05 am
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.

Posted: Tue Jul 07, 2009 1:57 pm
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

Posted: Tue Jul 07, 2009 2:20 pm
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#

Posted: Tue Jul 07, 2009 4:46 pm
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

Posted: Tue Jul 07, 2009 4:59 pm
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?

Posted: Tue Jul 07, 2009 5:03 pm
by dh_Madhu
Thanks Craig, I have already tried with a single address but shall try different combinations as you said......thanks again.

Posted: Wed Jul 08, 2009 3:51 am
by priyadarshikunal
Note that you need to remove field marks identified as @FM from the command output.

Posted: Wed Jul 08, 2009 6:39 am
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. :?