How can I list all tapes in a range that are not in delete status?
You can use TMSGRW or EARL and look at FLAG1 for the DEL bit being on. In EARL check the FLAG1_DEL field for Y or N to determine if the delete bit is on. You can see the flag definitions in CTERALCM member of CTAPECPB. If using TMSGRW you can define a field, call it DEL-BIT and give it a HX value of 02 and then check to see if it is ON or OFF. The values for the FLAGs are documented in the Programmers Guide.
EARL Example of the code to just check the FLAG bit. You will need to add any other code to check for the range etc.
IF FLAG1_DEL = 'Y'
THEN GOTO START
TMSGRW Example of the code to just check the FLAG bit. You will need to add any other code to check for the range etc.
DEFINE DEL-BIT HX '02'
WHEN FLAG1 ON DEL_BIT