Page 1 of 1

Passing Variables within a Job Sequence

Posted: Fri Nov 19, 2010 8:31 am
by chuckd248
I have a basic 3 'stage' job sequence.

1) Job Activity - Executes a DS job that creates a TXT file containing an integer which represents the identifier of the just completed nightly batch run (works fine)

2) Routine Activity - Reads the integer from the above file (works fine) and, if the number is anything > 0, it goes to:

3) Notification Activity - Sends an email stating the nightly batch run has completed.

My 'issue' is in step 3... it works fine as is but I want to customize the email by including the actual value of the identifier (mentioned in steps 1 and 2) in both the SUBJECT and BODY of the email message...

I have tried assigning the value to user status, return value, using a job parameter, etc) but when the email is produced, whatever variable I have tried to use, is always blank...

Anyone have any thoughts???...

Thanks...

Chuck

Posted: Fri Nov 19, 2010 9:40 am
by vinothkumar
Through notofication stage we can make the value coming in Subject but I am not sure about body. Instead you can attach the file itself in your notification stage.

Posted: Fri Nov 19, 2010 10:42 am
by JRodriguez
Chuck,

Sustitute the step 3 - the email notification - with a server job, inside the server job use DSSendMail

This routine allows the body to be a parameter. The arguments are { To address, From address, Subject line, Server name, Message body }

So the body could be anything that you conform in the job. Just play around with it. We have a lot of nice formatted emails with this routine


Regards

Posted: Fri Nov 19, 2010 11:16 am
by chuckd248
After my initial post, I discovered that the email body does not accept parameters (Parallel sequence) and instead simply inserts the hasehd parameter (e.g., #ParamName#)... so your suggestion to use a Server job will hopefully solve that part... I just have very little Server job experience...

The problem I'm having is that the parameters I've been trying to use are empty... I was able to use $jobstatus and $jobname just to test what I was trying to do and those values do show up... however, I do not know how or see any way to take advantage of $userstatus... all the posts talk about writing a routine, or writing BASIC code, or icluding something called DSSETUSERSTATUS()... none of which I've ever done... guess I will have to learn...