If the VSAM is empty then copy job abends There may be a situation where you have to copy a VSAM file to a flat file and if the VSAM file for some reason is empty then the sort copy job abends with abend code of U0016. Please refer the following JCL
//SORTIN DD DSN=VSAM.DSN,DISP=SHR //SORTOUT DD DSN=FLATFILE.DSN, // DISP=(NEW,CATLG,DELETE)
You can bypass this abend by specifying the VSAMEMT=YES parameter with Here is an example of the situation
//STEP001 EXEC PGM=SORT,PARM=’VSAMEMT=YES’ //SORTIN DD DSN=VSAM.DSN,DISP=SHR //SORTOUT DD DSN=FLATFILE.DSN, // DISP=(NEW,CATLG,DELETE)