Row Count
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
However you can not use this server function in a parallel job. The place to use it is either in an after-job subroutine or in a routine invoked from a Routine activity executed after the job in a job sequence. For example an after-job subroutine might have the following code (the file pathname is given in the Input Value field):
If you were also to provide the stage name and link name through the Input Value field, you would have a useful re-usable component.
Code: Select all
SUBROUTINE AddLinkRowCount(InputArg, ErrorCode)
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
ErrorCode = 0 ; * set to non zero value to abort job
RowCount = DSGetLinkInfo(DSJ.ME, "loader", "order_feed", DSJ.LINKROWCOUNT)
Shell = "UNIX"
Command = "echo " : RowCount : " >> " : FilePath
Output = ""
ExitStatus = -999
Call DSExecute(Shell, Command, Output, ExitStatus)
If ExitStatus <> DSJE.NOERROR
Then
Call DSLogWarn("Error in writing trailer" : @FM : Output, "AddLinkRowCount")
End
RETURN
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Alternatively you can use the OS command option.
Code: Select all
dsjob -linkinfo $Project $Job $Stage $Link | grep 'Link Row Count' | awk '{print $5}'`
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
-
- Participant
- Posts: 54
- Joined: Wed Oct 25, 2006 11:07 pm
- Location: Hyderabad
Re: Row Count
Hi, Yup u r right. We can use the DSGetlinkInfo function. U have to associate ur job with an after job subroutine first.
Follow the code snipet
intNoRecInput=DSGetLinkInfo(DSJ.ME,Stage_Input,Link_Input,DSJ.LINKROWCOUNT)
//here the row count on Link_input is stored in variable intNoRecInput
//Now writting the Count to FILE
OpenSeq strFile To objFileVar
Else Create objFileVar Else ErrorCode =1
WeofSeq objFileVar
WriteSeq FMT("Input Record Count : ","30L"):FMT(intNoRecInput, "12'0'R") To objFileVar Then
End
CloseSeq objFileVar
//How to pass stage name and link name to subroutine
//Here stage name is the name from which the link getting originated
//Link name is the name of the link
Stage_Input=Field(InputArg,';',1)
Link_Input=Field(InputArg,';',2)
In the job click on the job property, select the after job sub routine from the drop down box. pass the stage name and link name separated by a ';'
Another ';' after link name (Remeber names are case sensitive).
The count will be written in to File
Thanks in Advance.[/quote]
Follow the code snipet
intNoRecInput=DSGetLinkInfo(DSJ.ME,Stage_Input,Link_Input,DSJ.LINKROWCOUNT)
//here the row count on Link_input is stored in variable intNoRecInput
//Now writting the Count to FILE
OpenSeq strFile To objFileVar
Else Create objFileVar Else ErrorCode =1
WeofSeq objFileVar
WriteSeq FMT("Input Record Count : ","30L"):FMT(intNoRecInput, "12'0'R") To objFileVar Then
End
CloseSeq objFileVar
//How to pass stage name and link name to subroutine
//Here stage name is the name from which the link getting originated
//Link name is the name of the link
Stage_Input=Field(InputArg,';',1)
Link_Input=Field(InputArg,';',2)
In the job click on the job property, select the after job sub routine from the drop down box. pass the stage name and link name separated by a ';'
Another ';' after link name (Remeber names are case sensitive).
The count will be written in to File
Thanks in Advance.[/quote]
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: