View - Procedure needed to mass delete reports in View
search cancel

View - Procedure needed to mass delete reports in View

book

Article ID: 231120

calendar_today

Updated On:

Products

View

Issue/Introduction

We are planning to clean up the View database for particular Sysout ID's.

Is there a way to delete all entries of a particular Sysout ID from View?

Environment

Release : 14.0

Component :

Resolution

If you want to mass delete reports in a View database, you can use the following SARGRW program to create SARBCH /DELETE transactions:


//XXXXXXXX JOBCARD...
//SARGRW01 EXEC PGM=SARGRW                               
//*STEPLIB  DD   DISP=SHR,DSN=your.view.CVDELOAD    <=== Modify, if used
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(5),,CONTIG)         
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(5),,CONTIG)         
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(5),,CONTIG)         
//SYSUDUMP DD SYSOUT=*                                   
//SYSOUT   DD SYSOUT=*                                   
//SYSPRINT DD SYSOUT=*                                   
//PRTFILE  DD SYSOUT=*                                   
//OUTFILE  DD  DISP=(,CATLG,DELETE),                          
//             DSN=xxxxxx.xxxxxx.SARGRWOP,            
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000),    
//             SPACE=(CYL,(10,1),RLSE), 
//             UNIT=3390,VOL=SER=xxxxxx
//SYSIN    DD *                                          
/CONTROL SEQ=RID DATABASE=view_dbhlq   <=== Modify DB name
/IF SUBSTR(ID,1,nn) = 'xxxxxxxxxxxxx '   <=== Modify IF stmt
/ OUTPUT '/DELETE ID='     COL(1)                          
/ OUTPUT ID                COL(12)                           
/ OUTPUT ' GEN='           COL(44)    
/ OUTPUT EDIT(GEN,'99999') COL(49)
/ OUTPUT ' SEQ='           COL(54)    
/ OUTPUT EDIT(SEQ,'99999') COL(59)
/END                              
/*                                
//   


NOTE - FOR THE ABOVE IF STATEMENT

- The value to specify for the 'xxxxxxxxxx 's would be that of the fully qualified SYSOUT ID, with a blank space added at the end.  
- The value to specify for 'nn' would be the total number of characters for the FULL SYSOUTID, plus 1, to account for the blank space.


After running the above, then you can run the resulting file through the SARBCH program:


//XXXXXXXX JOBCARD...                                              
//SARBCH   EXEC PGM=SARBCH,PARM='view_dbhlq'   <=== MODIFY DB NAME  
//*STEPLIB  DD  DISP=SHR,DSN=your.view.CVDELOAD   <=== MODIFY, IF USED
//SYSPRINT DD  SYSOUT=*                                           
//REPORT   DD  SYSOUT=*                                           
//SYSIN    DD  DISP=SHR,DSN=xxxxxx.xxxxxx.SARGRWOP
//


NOTE:  It is recommended that you try the above procedure first on a few test reports, in a test environment, before attempting to delete any reports from production.