Hi,
We have a requirement where we aggregate a few records and write the record count out to a sequential file. When zero records are passed through the Aggregator, the output of the Aggregator does not write any record on the output file. But we have a need where we have to write the record count value as "0" (zero) in such a case.
Please let us know if anyone have handled such kind of thing before.
Thanks.
Create an output record when zeros rows are passed thro it
Moderators: chulett, rschirm, roy
Easy. Always pass one row by fabricating one. You can do this many ways, just make sure it doesn't skew counts or averages.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
hi,
I did it in the after job subroutine through unix command by checking for the word count in the file.if the wordcount in the file is 0 then i appended 0 to the file.
But now i need the same to be implemented in windows server for which I am not able to find the command to do the above check.
Kindly anyone let me know about how it can be done for windows server.
Thx,
Rajee
I did it in the after job subroutine through unix command by checking for the word count in the file.if the wordcount in the file is 0 then i appended 0 to the file.
But now i need the same to be implemented in windows server for which I am not able to find the command to do the above check.
Kindly anyone let me know about how it can be done for windows server.
Thx,
Rajee
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
I had a similar issue and used a join stage - full outer join.
One input to the join would be from the Aggregator - you'll need to add a new column e.g. Key, hard coded to value of 1 using a transformer.
The other input to the join comes from a row generator that creates one record with the same field Key, again hard coded to 1.
The outer join will always produce 1 record because of the row generator, you can then test for null from the aggregator's count field and default to zero as required. Make sure the count field is nullable.
One input to the join would be from the Aggregator - you'll need to add a new column e.g. Key, hard coded to value of 1 using a transformer.
The other input to the join comes from a row generator that creates one record with the same field Key, again hard coded to 1.
The outer join will always produce 1 record because of the row generator, you can then test for null from the aggregator's count field and default to zero as required. Make sure the count field is nullable.