CA1 How recover the result on the //OUTPUT dd dsn=xxx during a TMSGRW

Document ID : KB000113720
Last Modified Date : 13/09/2018
Show Technical Document Details
Issue:

Running the following TMSGRW pgm, the file assigned on the //OUTPUT dd keep only one volser but the report recovered on the TMSRPT is correct:

/TMSGRW PROC PRM=, 
// REGN='4M', 
// SOUT='*' 
//TMSGRW EXEC PGM=TMSGRW,REGION=&REGN, 
// PARM='&PRM' 
//TMSRPT DD SYSOUT=* 
//OUTPUT DD DSN=L225427.TAPES.REPORTED.ON, * OPTIONAL * 
// DISP=(NEW,CATLG,DELETE), 
// UNIT=3390,SPACE=(CYL,(5,5)), 
// DCB=(RECFM=FB,LRECL=340,BLKSIZE=23460) 
//* ABOVE BLKSIZE SHOULD BE A MULTIPLE OF 340 
//SYSOUT DD SYSOUT=&SOUT 
//SYSUDUMP DD SYSOUT=&SOUT 
// PEND 
//REPORT EXEC TMSGRW 
//TMSGRW.SYSIN DD * 
CONTROL-SECTION 
SORT VOLSER 
ALTER DSNB=YES 
DEFINE SCRBIT HX '04' 
PROCESS-SECTION 
WHEN VOLSER EQ VOLSER 
LIST 
REPORT-SECTION 
PRINT VOLSER 
 
Resolution:
This file is opened multiple time during the TMSGRW. 
If you don't you will get only the last information written to the file  DISP=MOD shoudl be coded.