How to check if a data set is empty using the LISTD command?
Component : Disk Backup and Restore
Refer the DISK documentation for Subfile Record Format - (DSNINDEX) for more information
DSNFLAG6 DS X +93 FLAG BYTE 6
DSNP2 EQU X'80' ..PRIMARY2 DSNINDEX
DSNRENMD EQU X'40' ..DSNINDEX RENAMED
DSNFAST EQU X'20' ..FAST ARCHIVE
DSNNEWNM EUQ X'10' ..ARCHIVE with NEWNAME or NEWHLQ
DNSEMPTY EQU X'08' ..EMPTY DATA SET
the last position of FLAG6 field contains the information if the data set is empty. This field can be included in the LISTD command output, specifying FIELD FLAG6 (even if the LISTD explanation doesn't report it). All the data sets with FLAG6 ending with an 8, are empty.