I am using a Routine SetUserStatus in Stage variables in my jobs to capture info that is needed in next stages. But if the datasource is emtpy, there are no records flowing through the transformer and the Stage variable will not get a value.
SetUserStatus Routine:
Code: Select all
$INCLUDE DSINCLUDE JOBCONTROL.H
ErrorCode = 0
Call DSSetUserStatus(Status)
Call DSLogInfo("User Status Set To: ":Status, "SetUserStatus")
Ans = Status
SetUserStatus(If Read_Status.record_count_valid = RowCount Then 'OK' Else 'NotOK')
RowCount is a variable from the previous stage.
What I want to accomplish is that if RowCount = 0 and record_count_valid is null because the data source is empty, that the UserStatus also returns 'OK' but I don't seem to be able to accomplish this.
Any thoughts?
TIA
Martina