Suppress duplicate DSN records in TMSGRW REPORT

Document ID : KB000118014
Last Modified Date : 23/10/2018
Show Technical Document Details
Question:
In my TMSGRW REPORT data sets are listed multiple times. What is the reason for this and how can this be prevented, so that each data set is listed only once?
For example:

VOLSER   DSN                                            VOLSEQ   NUMDSNB   
                                                                                                                                                     
S00045   TESTSYS.MTL.MVMF2.D181023.T141917.FILE1        00001    00000    <-  
S00046   TESTSYS.MTL.MVMF2.D181023.T141917.FILE1        00002    00001    <- 
S00046   TESTSYS.MTL.MVMF2.D181023.T141917.FILE2        00002    00002     
S00046   TESTSYS.MTL.MVMF2.D181023.T141917.FILE3        00002    00003     
S00047   TESTSYS.MTL.MVMF2.D181023.T141917.FILE1        00003    00001    <-
S00047   TESTSYS.MTL.MVMF2.D181023.T141917.FILE4        00003    00004     
S00048   TESTSYS.MTL.MVMF2.D181023.T141917.FILE1        00004    00001    <- 

 
Answer:
The duplicate DSN records are the records from the chained volumes. These are records 
with VOLSEQ > 1 and NUMDSNB = 0 or NUMDSNB = 1 (depending on which volume the first 
DSNB starts). To exclude these records add

DEFINE MYVSEQ BI '1' 
DEFINE MYFSEQ BI '2' 


to the CONTROL SECTION and insert the following REJECT statement before the LIST 
statement in the PROCESS-SECTION: 

WHEN VOLSEQ GT MYVSEQ AND NUMDSNB LT MYFSEQ 
REJECT
 

This will exclude the records for the chained volumes:

VOLSER   DSN                                            VOLSEQ   NUMDSNB   CDATE                                                                                                                                                                          
S00045   TESTSYS.MTL.MVMF2.D181023.T141917.FILE1        00001    00000     2018/296 
S00046   TESTSYS.MTL.MVMF2.D181023.T141917.FILE2        00002    00002     2018/296 
S00046   TESTSYS.MTL.MVMF2.D181023.T141917.FILE3        00002    00003     2018/296 
S00047   TESTSYS.MTL.MVMF2.D181023.T141917.FILE4        00003    00004     2018/296