You have a batch JCL that runs an Endevor report (such as Report 42) and need to drive subsequent steps in the JCL based on whether the report includes data.
Checking this is difficult because there is always output printed to ddname BSTRPTS (for example, the record extract counts), and the program C1BR1000 returns RC 0 to the JCL regardless of whether there is no data reported.
All supported releases of Endevor
Check the contents of the SORTIN dataset. This file receives all the records from the extraction phase. If it contains zero records, this means that no reports will be produced
If you are producing a single report type, follow these steps in your JCL:
PRINT INFILE(SORTIN_DD) OUTFILE(DUMMY_DD) COUNT(1)
This method is effective for jobs producing a single report. If your job produces multiple reports, all extracted records are consolidated into the SORTIN DD, and you would need to count records by report type. The report type is a one-byte binary field at position 1 of the extract file.