Tuesday, December 4, 2012

Server Routine to find Job type In Datastage


Code:
$INCLUDE DSINCLUDE JOBCONTROL.H 
handle=DSAttachJob (Arg1,DSJ.ERRFATAL) 
if handle <> 0 Then 
jobName=DSGetJobInfo(handle,DSJ.JOBNAME) 
jobStatus=DSGetJobInfo(handle,DSJ.JOBSTATUS) 
JOBTYPE = TRANS("DS_JOBS", jobName, 6, "X") 
JobTypeDesc = FIELD('Server|Sequence|Parallel|Mainframe','|',JOBTYPE,1) 
Ans="Job Name is : " : jobName : " and job type is :" : JobTypeDesc 
End 
Else 
Ans="Invalid.. Please enter a valid Job/Sequence name." 
End 

User has to Pass Proper Jobname to Arg1 to get the Proper Output and test the Routine using Test option

2 comments:

  1. Hi Vamsi,
    Could you please throw some light on finding sequencer job status using routine ? There are 5 sequencer jobs, I want to kickoff the 5th sequencer if all the first 4 ran successful and I want to achieve this with routine since datastage server is running on Windows server. Is there any method other than routine to achieve this? Please advise me.

    Thank you,

    Regards,
    Bhanu.

    ReplyDelete