Page 1 of 1

Passing Activity Variable value as an Email Subject

Posted: Thu Aug 22, 2013 9:03 pm
by SURA
Hi there

I created a Sequence to backup individual jobs. All fine expect email notification. All i am trying to do is, in the email subject it trying the pass the number of job (counts) to export. But for some reason i am not able to make it.

Code: Select all

Total Number of Jobs : #Getcount.$CommandOutput# 

In here GetCount is the Command Activity stage placed before the mail. 
Job aborted with the below error

Code: Select all

Export_Individual_DSJob_1..JobControl (DSSendMail): Parameter 4 ('') does not start with a keyword
If i pass any other Parameter then its fine!!

Let me know how to handle it?

Re: Passing Activity Variable value as an Email Subject

Posted: Thu Aug 22, 2013 9:15 pm
by SURA
Fails to add one more point, I tried like below too.

Code: Select all

Trim(#Getcount.$CommandOutput#,@FM,"A") 
and getting the below error.

Export_Individual_DSJob_1..JobControl (DSSendMail): Parameter 4 (',@FM,"A") ') does not start with a keyword

Output of the GetCount is

Code: Select all

Export_Individual_DSJob_1..JobControl (@Getcount): Executed: cat  xxxxxxxxxxDS_JOB_NAMES.txt | wc -l
Reply=0
Output from command ====>
      2 

Posted: Thu Aug 22, 2013 11:48 pm
by ArndW
What happens if you try "FIELD(#Getcount.$CommandOutput#,@FM,1)" (or the short form "#Getcount.$CommandOutput#<1>")? I hadn't thought of using the TRIM() function the way you didn, I usually use "CONVERT(@FM,'',#Getcount.$CommandOutput#) to remove all field marks. If the error persists, then try to print out the command line after removing the field marks to see what other control characters might still be in the line.

Posted: Fri Aug 23, 2013 1:23 am
by ray.wurlod
Clearly you did not build your expression using the Expression Editor.

Had you done so you would have learned that activity variable references in expressions do not require surrounding sharp signs.

If it's only the integer portion you require, you could also use

Code: Select all

Oconv(Getcount.$CommandOutput,"MCN")

Posted: Fri Aug 23, 2013 1:55 am
by ArndW
I missed that part even though I cross-checked prior to posting and checked a job where I use variables in the subject line of e-mails.

Posted: Sun Aug 25, 2013 6:18 pm
by SURA
Hi Ray / ArndW

Unfortunately i am not winning with the code and that could be the way how i tried to implement & Or that much only i might understood could be the reason and sorry for that.

Let me explain what i have did!

ArndW

Code: Select all

"#Getcount.$CommandOutput#<1>" OR #Getcount.$CommandOutput#<1>

and i got the below outputs in the Director.

Export_Individual_DSJob_1..JobControl (DSSendMail): Parameter 4 ('<1>"') does not start with a keyword


Export_Individual_DSJob_1..JobControl (DSSendMail): Parameter 4 ('<1>') does not start with a keyword
Then i tried the below

Code: Select all

CONVERT(@FM,'',#Getcount.$CommandOutput#)

Export_Individual_DSJob_1..JobControl (DSSendMail): Parameter 4 (')') does not start with a keyword
Ray

I tried the below code too.

Code: Select all

Oconv(Getcount.$CommandOutput,"MCN")
Job ran successfully, but in the email subject i am getting Oconv(Getcount.$CommandOutput,"MCN") .

Let me know how to handle this?

Posted: Mon Aug 26, 2013 12:34 am
by arunkumarmm
Did you try with a user variable activity in between, passing your command output to a variable and then using your user variable in the email subject?

Posted: Mon Aug 26, 2013 5:48 pm
by SURA
Hi Guys

Thanks to all for your suggestions and guidance.

After added a Variable Activity before the email notification stage help me to pass the value in to the email subject.

Code: Select all

Trim (convert(@FM,',', Getcount.$CommandOutput),',',"A")