Server routine help needed

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

Server routine help needed

Post 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.
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post 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?
pandeeswaran
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

Post 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")
pandeesh
Premium Member
Premium Member
Posts: 1399
Joined: Sun Oct 24, 2010 5:15 am
Location: CHENNAI, TAMIL NADU

Post by pandeesh »

So, in the mail body whats getting passed?

SummaryArray or null?
pandeeswaran
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

Post 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

chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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 )
-craig

"You can never have too many knives" -- Logan Nine Fingers
sagar deshmukh
Participant
Posts: 103
Joined: Fri Jan 18, 2008 12:55 am
Location: chennai

Post by sagar deshmukh »

Thanks A lot this really helped.
Post Reply