Empty Source
Moderators: chulett, rschirm, roy
Empty Source
I have a situation where I will not be getting any data from my source, but I still need to populate a file with some hard coded data and a record count coming from the source. The source gives me no records, so it cannot populate the count and I get no output.
Probably several different ways to accomplish this. What we typically end up doing is breaking jobs up into a series of jobs or phases. We might write out an empty control record in an initial job that does whatever other 'prep' work is needed, have intermediate job(s) that actually process the data file(s), and then a final job that updates the control record with what actually happened. In this case the controlling batch may check row counts going down links and can then log them and pass them as parameters to the final job, or the job could pull counts from the target table. You can also use hash files between jobs to 'pass' information. You can sometimes condense this down into a single job using before- and after-job routines... really depends on exactly what you want to do.
Hope this helps,
-craig
Hope this helps,
-craig
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
One of the easiest things to do, if the output is a sequential file, is to create an after-stage routine that obtains the link row count then uses the operating system command echo to append the desired "trailer" record.
Similarly, one or more echo commands in a before-stage routine could create a "header" record.
It's not all that difficult to extend this to hashed files, UV tables or ODBC tables.
Similarly, one or more echo commands in a before-stage routine could create a "header" record.
It's not all that difficult to extend this to hashed files, UV tables or ODBC tables.