Passing Variables within a Job Sequence

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

Post Reply
chuckd248
Participant
Posts: 12
Joined: Tue May 19, 2009 6:13 am

Passing Variables within a Job Sequence

Post 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
vinothkumar
Participant
Posts: 342
Joined: Tue Nov 04, 2008 10:38 am
Location: Chennai, India

Post 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.
JRodriguez
Premium Member
Premium Member
Posts: 425
Joined: Sat Nov 19, 2005 9:26 am
Location: New York City
Contact:

Post 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
Julio Rodriguez
ETL Developer by choice

"Sure we have lots of reasons for being rude - But no excuses
chuckd248
Participant
Posts: 12
Joined: Tue May 19, 2009 6:13 am

Post 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...
Post Reply