Joined: 26 Apr 2004 Posts: 4650 Location: Raleigh, NC, USA
Nothing easy comes to mind. The only thing I can think of is that you'd have to write a program that would examine all of the required datasets and determine if they exist and if they are or aren't empty. Then, based on those statuses, it would create a custom job that includes only the valid datasets.
You could use an initial IEFBR14 step which specifies DISP=(MOD,CATLG) for the datasets together with necessary SPACE & DCB information. This will ensure that they at least exist for the following steps so you don't get JCL error. If they exist with or without data they will remain unchanged. If not, they will be created as empty files.
Next, insert steps to use DFSORT/ICETOOL to determine the count of records and set condition code 4 or 12 if empty. If the cond code for a dataset is zero, execute the step, else bypass.