Server name and project name in email subject line

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
avneeshrai
Participant
Posts: 12
Joined: Wed Jan 02, 2008 11:45 pm
Location: Hyderabad

Server name and project name in email subject line

Post by avneeshrai »

Hi,
How do we add the DS Server name and the Project name to the e-mails (Email Subject Line) produced following job execution.

I have searched this forum and not found any posts.

thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The subject can include job parameters. So you can run your job with one or two extra parameters in which these values can be set in the job sequence that runs the job (using a DS Macro), or just let them have appropriate defaults.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
avneeshrai
Participant
Posts: 12
Joined: Wed Jan 02, 2008 11:45 pm
Location: Hyderabad

Post by avneeshrai »

Thanks Ray,

I am using DSHostName , but it is giving me the value 'localhost' in the email!

I can use job parameters , but I wanted this to come from DS so that this job can be portable across projects.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try using an ExecuteCommand activity. Execute the command hostname (which is the same on UNIX or Windows) and use the command output, stripped of @FM characters, as the parameter value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
avneeshrai
Participant
Posts: 12
Joined: Wed Jan 02, 2008 11:45 pm
Location: Hyderabad

Post by avneeshrai »

Thanks for your inputs Ray, the issue stil persists!

I have built a sample job where we have

UserVariableStage--> ExecuteCommandStage--> NotificationStage

In the ExecuteCommand stage if I use hostname, and in the email subject if I use #CMD.$CommandOutput# where CMD is the execute command stage name I am getting the following error:

Parameter 4 ('') does not start with a keyword

(@SendFailEmessage): Controller problem: Unhandled failure (-19) encountered calling routine DSSendMail
If I use any other variable the job works fine, ex if I use #CMD.$ReturnValue#


Also when I go to the DS administrator and select the project and use the command I get the error

"Verb "HOSTNAME" is not in your VOC"

Currently I am using DSHostName , but it is giving 'localhost' as output !
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Did I not specify "trimmed of field mark characters"?

Code: Select all

Trim(#CMD.$CommandOutput#,@FM,"A")
The Admininstrator client does not execute natively in the operating system shell. But you can open one.

Code: Select all

DOS /C hostname
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
avneeshrai
Participant
Posts: 12
Joined: Wed Jan 02, 2008 11:45 pm
Location: Hyderabad

Post by avneeshrai »

Hi Ray,

Still getting the error:

JobControl (DSSendMail): Parameter 4 (',"@FM","A")') does not start with a keyword
Unhandled failure (-19) encountered calling routine DSSendMail

I even tried to use " around @FM in Trim(#CMD.$CommandOutput#,@FM,"A").

Also Ray, when I use DSHostName macro, is there anything we can do to get the box name instead of 'localhost' as the return value?

Thanks,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No space between the word Trim and its following left parenthesis.

No to your question about DSHostName.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
avneeshrai
Participant
Posts: 12
Joined: Wed Jan 02, 2008 11:45 pm
Location: Hyderabad

Post by avneeshrai »

Hi Ray,

I checked that also . There are No spaces between the word Trim and its following left parenthesis.

Thanks,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Then why is it complaining of Parameter 4 (',"@FM","A")') ?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
JITeam
Premium Member
Premium Member
Posts: 17
Joined: Mon Mar 24, 2008 9:43 am

Post by JITeam »

Hi All,

Is it possible to capture this box name with out using the command stage as command stage might not work on UNIX env.


Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard. We are not talking about the Command stage here; we're talking about the Execute Command activity in a job sequence.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

Post by satheesh_color »

Hi,

Did you try with the below DS macros

DSHostName : ":Notification (" : Substrings(DSProjectName,4,4) : ") - " : Subject





Satheesh.
Post Reply