In SRAM is there a way for me to return a rc when the outfile is empty ?

Document ID : KB000125004
Last Modified Date : 21/01/2019
Show Technical Document Details
SRAM is a called and linked internal sort utility for use within user written programs.
When using SRAM in my program  is there a way for me to return a RC when the outfile is empty ?
z/VSE any level
SRAM any level
1) If using a 'program invoked" sort process you can use the INVCNCL= parm to pass a specific return code. So, if your program knows the file is empty it could pass a return code of 0. 

See the System programmer Guide for SORT page 2-10 

2) Page 2-11 specifies the RC= parm which is used in JCL were you ignore the return code for return code checking if you would not want to bother checking and continue processing. 

However, if you are only using JCL and not program invoked SRAMM/SORT then there is no way that SORT checks for OUTFIL data to see if it is a full file, has data in it, or is even valid. This would be more the program invoked function. 

Add some logic to ask if it wrote records, if NO then pass a RC=0. Simple logic to follow but if we are talking JCL then we are talking basic CL functions with condition checking external to the actual sort process. 
Additional Information:
See the System programmer Guide for SORT page 2-10