Showing posts with label Server Routine. Show all posts
Showing posts with label Server Routine. Show all posts

Thursday, December 6, 2012

Server Routine to count the no of lines in a file?

In many cases User should trigger the Jobactivity for each record in the file. In that case Developer can use following server Routine to count the no of lines in a file which can be used in final counter value for Start Loop Activity.Please find the atachment


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