Well, depending on the
operating system and the maximum number of files found in this particular
example, you could set the return code on exit from the shell to that
number. In Unix, depending on the flavor,
I believe that the maximum value is 255.
You could then use the GET_STATISTIC_DETAIL and retrieve theRETURN_CODE as the value. However, this technique may affect your task’s
Runtime Ended_OK processing and obscure other processing errors.
Though I’ve never tried it, I
guess that you could call the API from your program and do an RSET of a script
variable or store the value in a Variable so it would be available to the Post Process. There is also the Output Scan, but that is again something that I have no experience with and don't know all of its capabilities and limitations.
Using the PREP_PROCESS_REPORT technique is at least the most obvious and is "passive" and can be used with great reliability. It is the technique that we have standardized on when needing this type of logic.