What starts off your job? The arrival of the file from the other system?
If you want to know whether a dataset is catalogued, you can use IDCAMS LISTCAT, and set a return-code so that you can establish the outcome for step(s) in a JOB. Using IDCAMS PRINT you can, if the file exists, "print" one record, which will tell you if the dataset contains data or not, and set a return-code...
Sort can also do the "counting-and-return-code", but if you are using IDCAMS you could do them both at the same time.
I hope that the file contains a header, with at least the business/data date, and hopefuly a "logical filename". A trailer, with record count, hash counts for key fields. Then when the file is processed, all of this can be verified. An "empty" file coming from your other system should contain a header/trailer but no data. Then you know that if you receive an actual empty file, something has "gone up the swanee...".
- These users thanked the author BillyBoyo for the post:
- Eagle (Fri Feb 15, 2013 6:13 pm)