I have a situation where i count the records in a file and when the file is empty I need the count to be zero. But In DataStage it is not outputting anything.
Please advise.
Zero count
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Yes, that seems like a reasonable requirement.
What do you get out of DataStage when there ARE records in the file? How are you calculating this?
Think about how any calculation could be performed if no records are passing through the job.
What you need to do is to detect whether the file is empty (perhaps in a Routine activity, perhaps in an Execute Command activity). Based on that result, either write 0 to the target or run the DataStage job.
What do you get out of DataStage when there ARE records in the file? How are you calculating this?
Think about how any calculation could be performed if no records are passing through the job.
What you need to do is to detect whether the file is empty (perhaps in a Routine activity, perhaps in an Execute Command activity). Based on that result, either write 0 to the target or run the DataStage job.
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.
-
- Participant
- Posts: 64
- Joined: Tue Sep 23, 2008 9:54 am
-
- Participant
- Posts: 64
- Joined: Tue Sep 23, 2008 9:54 am
I am not a premium member, so I don't know if you already provided the solution or not...sometimes I wish I was a premium member. :-(ray.wurlod wrote:Yes, that seems like a reasonable requirement.
What do you get out of DataStage when there ARE records in the file? How are you calculating this?
Think about how any calculation could be performed ...
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Zero count
Are you doing your counting in an Aggregator stage or outside of DataStage? Can you use an operating system command (you should have MKS installed) like 'wc -l' ?datastagenewbie wrote: I have a situation where i count the records in a file and when the file is empty I need the count to be zero. But In DataStage it is not outputting anything.
Please advise.