Page 1 of 1

Server routine help needed

Posted: Tue Apr 12, 2011 5:09 am
by sagar deshmukh
Hi ,

I have written a routine to extract the Fatal error logs and send it through mail.

Routine is as follows : -

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H 

***CallingProgName = DSJ.ME

rJobHandle = DSAttachJob(Jobname, DSJ.ERRNONE)
JobStartTime = DSGetJobInfo(rJobHandle, DSJ.JOBSTARTTIMESTAMP) 
JobEndTime = DSGetJobInfo (rJobHandle, DSJ.JOBLASTTIMESTAMP)


SummaryArray = DSGetLogSummary(rJobHandle, DSJ.LOGFATAL, JobStartTime, JobEndTime, 0)


Mail = DSSendMail("From:DataStage-Development@winn-dixie.com\nTo:Sagardeshmukh@winn-dixie.com\nServer:wdims\nSubject:rJobHandle Failed !\nBody:SummaryArray")


DetachResult = DSDetachJob(rJobHandle)

Ans = Mail
All I want is the Mail content should be the all Fatal error for perticular job but I am getting "SummaryArray" as mail content instead of value of "SummaryArray" which will be the error logs for that perticular job.

Values of "SummaryArray" is not getting passed as a parameter. could you please help me out regarding this.

Thanks
Sagar.

Posted: Tue Apr 12, 2011 5:44 am
by pandeesh
Values of "SummaryArray" is not getting passed as a parameter
may i know where and how you are passing that as a parameter?

Posted: Tue Apr 12, 2011 5:48 am
by sagar deshmukh
Hi,

Sorry for wrong words,

1)I am getting error logs as below :

SummaryArray = DSGetLogSummary(rJobHandle, DSJ.LOGFATAL, JobStartTime, JobEndTime, 0)

these error logs captured in "SummaryArray" needs to pass to the below DSSendMail , which is not happeing here....


Mail = DSSendMail("From:DataStage-Development@winn-dixie.com\nTo:Sagardeshmukh@winn-dixie.com\nServer:wdims\nSubject:rJobHandle Failed !\nBody:SummaryArray")

Posted: Tue Apr 12, 2011 6:05 am
by pandeesh
So, in the mail body whats getting passed?

SummaryArray or null?

Posted: Tue Apr 12, 2011 6:18 am
by sagar deshmukh
Hi,

I am geting mail like this :

Code: Select all

-----Original Message-----
From: DataStage-Development@.com [mailto:DataStage-Development@.com]
Sent: Tue 4/12/2011 7:33 AM
To: Sagar Deshmukh
Subject: rJobHandle Failed !
 
SummaryArray


Posted: Tue Apr 12, 2011 6:21 am
by chulett
That's because it's inside quotes and thus just text. Build the string properly so it can be resolved:

...Failed !\nBody: " : SummaryArray )

Posted: Wed Apr 13, 2011 4:09 am
by sagar deshmukh
Thanks A lot this really helped.