gateleys wrote:
That's because your design doesn't allow for a parallel execution. And you don't want to do it any other way.
Here's the analogy: Guy wants to shoot a deer, such that it pierces through its heart. Oh yes, and he wants it alive.
Sorry about the graphic explanation. Just thought its OK on a Halloween Eve.
Thanks for the analogy, so I need to write a Before/After Subroutine and call via a routine activity in the job sequence after the job runs.
Thanks.
But I guess there is a problem in that, I need the informations in the file, No. of rejected recorsd needs to be a calculated field , In - Out and how will I pass the arguments such as Job Name, Link name, Stage Name in the job.
pravin1581 wrote:how will I pass the arguments such as Job Name, Link name, Stage Name in the job.
After Job routines take a single argument: InputArg. If you need to pass in multiple values, send them in as a delimited string and parse it apart as one of the first steps in the routine - typically using the FIELD function.
-craig
"You can never have too many knives" -- Logan Nine Fingers
pravin1581 wrote:how will I pass the arguments such as Job Name, Link name, Stage Name in the job.
After Job routines take a single argument: InputArg. If you need to pass in multiple values, send them in as a delimited string and parse it apart as one of the first steps in the routine - typically using the FIELD function.
But how will I call the routine in the routine activity and pass values to it and ultimately the information needs to be in the file..
How do you call it in a Routine Activity stage? I'm flabbergasted by that question - you simply point to the name of the routine using the ellipsis (...) button. That or just drag the routine itself onto the canvas from the repository browser. Just like any other stage.
Pass values to it? You 'hard code' them - type them in. Not sure what else to say other than that.
The information needs to be in the file. So, write it to 'the file'. Either take your routine results and pass them to a simple job which writes them for you or open the file and write to it right there in your routine.
This isn't rocket science here.
-craig
"You can never have too many knives" -- Logan Nine Fingers
Before/after subroutines do not show up in the list of functions callable from the Routine activity, because they are not functions. You need to create an interlude function if you want to call a before/after subroutine from a Routine activity.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
If you plan on using the routine in a Sequence job via the Routine Activity stage rather than Before or After job - then don't create it as a 'Before/After' routine. That will simplify things and help with your parameter passing confusion.
Ray - I just tested your assertion and find that I can, indeed, pick Before/After routines in a Routine Activity stage just like any other.
-craig
"You can never have too many knives" -- Logan Nine Fingers
How do you call it in a Routine Activity stage? I'm flabbergasted by that question - you simply point to the name of the routine using the ellipsis (...) button. That or just drag the routine itself onto the canvas from the repository browser. Just like any other stage.
Pass values to it? You 'hard code' them - type them in. Not sure what else to say other than that.
The information needs to be in the file. So, write it to 'the file'. Either take your routine results and pass them to a simple job which writes them for you or open the file and write to it right there in your routine.
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
hJob = DSAttachJob(JobName, DSJ.ERRFATAL)
If NOT(hJob) Then
Call DSLogFatal("Job Attach Failed", "JobControl")
Abort
End
Else
Ans = DSGetLinkInfo (hJob, StageName, LinkName, DSJ.LINKROWCOUNT)
End
DetachResult = DSDetachJob(hJob)
Should I give the path of the file in the routine itself and how, it seems that we are forgetting about the rejected record calculation and that needs to done as In-Out , can that be incorporated in the routine as well.
Below is the routine for getting the count from the link.
Jobname and linklist is the args.
$INCLUDE DSINCLUDE JOBCONTROL.H
* Check for empty JobName
If JobName = "" Then Goto ERROR
* Attach the job
JobHandle = DSAttachJob(JobName,DSJ.ERRFATAL)
* Get the number of links to process
RowNum = Dcount(LinkList,'|')
* Initialize TotalRowCount
TotalRowCount = 0
* Loop for each Link to get the number of rows
For i=1 To RowNum
SLName = Field(LinkList,'|',i)
StageName = Field(SLName,',',1)
LinkName = Field(SLName,',',2)
RowCount = DSGetLinkInfo(JobHandle, StageName, LinkName, DSJ.LINKROWCOUNT)
If RowCount >= 0 Then TotalRowCount += RowCount
Next i
END:
Ans=TotalRowCount
Return(Ans)
ERROR:
Ans=0
Return(Ans)
steps:-
1) create the one multiple instance job in server edition.
Below is the routine for getting the count from the link.
Jobname and linklist is the args.
$INCLUDE DSINCLUDE JOBCONTROL.H
* Check for empty JobName
If JobName = "" Then Goto ERROR
* Attach the job
JobHandle = DSAttachJob(JobName,DSJ.ERRFATAL)
* Get the number of links to process
RowNum = Dcount(LinkList,'|')
* Initialize TotalRowCount
TotalRowCount = 0
* Loop for each Link to get the number of rows
For i=1 To RowNum
SLName = Field(LinkList,'|',i)
StageName = Field(SLName,',',1)
LinkName = Field(SLName,',',2)
RowCount = DSGetLinkInfo(JobHandle, StageName, LinkName, DSJ.LINKROWCOUNT)
If RowCount >= 0 Then TotalRowCount += RowCount
Next i
END:
Ans=TotalRowCount
Return(Ans)
ERROR:
Ans=0
Return(Ans)
steps:-
1) create the one multiple instance job in server edition.