> For the complete documentation index, see [llms.txt](https://docs.editran.onesait.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.editran.onesait.com/documentacion-editran/ibm-editran-v5.3-ims/utilidades-ims/borrado-tampon-emisor-receptor/borrado-de-la-base-de-datos.md).

# Borrado de la base de datos

Otro proceso BMP tomará la lista de sesiones generada en el paso previo y procederá al borrado efectivo de la base de datos.

La entrada es la lista de sesiones ZTBGFSES que generó el ZTBGJBO1 y una ficha SYSIN con un parámetro que indica si se desea actuar sobre el tampón de emisión o el de recepción. Esta lista debe ser verificada por el usuario para evitar el borrado de sesiones que todavía son útiles. Su contenido puede ser modificado manualmente.

El proceso no verifica el estado de la emisión/recepción en Editran. Tampoco realiza ningún tipo de ENQ sobre la sesión de presentación. Se aconseja realizar una copia de seguridad antes de realizar el borrado.

El proceso se lanza con el JCl ZTBGJBO2.

Se ejecuta en una BMP con opción de escritura sobre la base de datos que realiza CHKP-POINT cada 100 registros borrados o cada cambio de sesión. Podríamos ejecutarla con la PSB de carga de IGA ZTBGEIG1, con la precaución de no bloquear otros procesos de carga. El borrado se ejecuta sesión a sesión leyendo por acceso directo cada uno de los registros (sumando 1 para leer el siguiente), de forma idéntica a como lo hace el producto.

La salida es un listado indicando el número de registros borrados en cada sesión.

Si proceso se interrumpiese podría ser relanzado indicando la misma lista de sesiones.

Los errores se mostrarán en el log de Editran/G.

## ZTBGJBO2.

Para borrar las sesiones seleccionadas en el informe previo utilizamos el fichero ZTBGFSES obtenido allí, indicando en la SYSIN si es en Emisión o Recepción.

```cobol
 EDIT       KI.EGDI.ZTBG.JCLS(ZTBGJBO2) - 01.12             Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR 
//KI0E8A2B JOB (EGDC,KIT,,99),'ZTBGJBO2',MSGCLASS=H,CLASS=A,   
//             NOTIFY=&SYSUID                                  
//LIBPROC JCLLIB ORDER=IMSP.PROCLIB                            
//*------------------------------------------------------------
//*   BORRADO DE LA B.D. DE EMISION/RECEPCION. PASO 2          
//*   EJECUTAR PREVIAMENTE ZTBGJBO1                            
//*    BORRA INCONDICIONALMENTE LOS REGISTROS DE TAMPON DE LAS 
//*    CONTENIDAS EN ZTBGFSES                                  
//*   EJECUTAR DESPUES ZTBGJPET                                
//*------------------------------------------------------------
//*------------------------------------------------------------
//*                                                            
//*FORMATO DEL FICHERO DE SESIONES                             
//*                                                            
//*      LLLLLLLLL-RRRRRRRRR-PPPPPP-N-TTTTTT                   
//*                                                            
//*      LLLLLLLLL  CODIGO LOCAL                               
//*      RRRRRRRRR  CODIGO REMOTO                              
//*      PPPPPP     APLICACION DE PRESENTACION                 
//*      N                                                     
//*      TTTTTT     APLICACION DE TRANSMISON                   
//*                                                            
//*FORMATO DE SYSIN X:                                         
//*      E - EMISION                                           
//*      R - RECEPCION                                         
//*------------------------------------------------------------
//ZTBGEBO2  EXEC IMSBATCH,MBR=ZTBGEBO2,PSB=ZTBGEBO2,REGION=0M  
//STEPLIB  DD DSN=KI.EGDI.LOAD,DISP=SHR                        
//SYSOUT   DD SYSOUT=*                                         
//CEEDUMP  DD SYSOUT=*                                         
//ZTBGFLOG DD SYSOUT=*                                         
//ZTBGFLIS DD SYSOUT=*                                         
//ZTBGFMSJ DD SYSOUT=*                                         
//ZTBGFPRI DD SYSOUT=*,DCB=(BLKSIZE=105)                       
//ZTBGFINF DD SYSOUT=*                                         
//*SECUENCIAL DE 80                                            
//ZTBGFSES DD DSN=KI.EGDI.ZTBG.ZTBGFSES,DISP=SHR               
//SYSIN    DD   *                                              
E                                                              
//                                                             
```

## Listado. <a href="#toc28427751" id="toc28427751"></a>

La ejecución del borrado indicará los registros reales eliminados.

```
   FECHA : 23/06/2026  B O R R A D O   B. D.  R E C E P C I O N (ZTBPDEMD) -EDITRAN-    PAGINA:   1
   HORA  : 17:03:40                                                            
                                                                               
                     REGISTROS       LOCAL    REMOTO   APLICA                  
                  ---------------  --------- --------- ------                  
                                5  000099980 000099940 CE9994                  
                                5  000099980 000099940 CE9998                  
                                5  000099980 000099940 EE9994                  
                                4  000099980 000099940 ER9998                  
                                9  000099980 000099940 OR9998                  
                            2.352  000099980 000099940 PRUEBA                  
                            2.756  000099980 000099940 PRUMJ1                  
                                5  000099980 000099940 TE9994                  
                                5  000099980 000099940 VR9994                  
        -------------------------  --------------------------                  
        TOTAL REG:          5.146  TOTAL SESIONES:         09
                  
                   ***   F I N     D E    L I S T A D O   ***                                                         
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.editran.onesait.com/documentacion-editran/ibm-editran-v5.3-ims/utilidades-ims/borrado-tampon-emisor-receptor/borrado-de-la-base-de-datos.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
