> 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-comun-z-os/interfaces-de-programas-de-aplicacion/consulta-del-estado-de-presentacion/ejemplo.md).

# Ejemplo

La copy del ZTBGBA01.

```cobol
  WORKING-STORAGE SECTION.
 *-----------------------
  01  ÁREA-ZTBGBA01                    PIC X(250).  
  01  FILLER REDEFINES ÁREA-GBA01.               
      05 ÁREA-ENTRADA-GBA01         PIC X(100).  
      05 FILLER REDEFINES ÁREA-ENTRADA-GBA01.    
         10 FUNCION-GBA01           PIC 9(2).    
         10 SENTIDO-GBA01           PIC X.       
         10 SESION-PRESENTACION-GBA01.           
            15 LOCAL-GBA01          PIC X(9).    
            15 FILLER REDEFINES LOCAL-GBA01.     
               20 FILLER            PIC X.       
               20 LOCAL-2-GBA01     PIC X(7).    
               20 FILLER            PIC X.       
            15 REMOTO-GBA01         PIC X(9).    
            15 FILLER REDEFINES REMOTO-GBA01.    
               20 FILLER            PIC X.       
               20 REMOTO-2-GBA01    PIC X(7).    
               20 FILLER            PIC X.       
            15 APLICACION-GBA01     PIC X(6).    
         10 INTERV-WAIT-GBA01       PIC X(6).              
         10 FILLER REDEFINES INTERV-WAIT-GBA01.            
            15 HH-WAIT-GBA01        PIC 9(2).              
            15 MM-WAIT-GBA01        PIC 9(2).              
            15 SS-WAIT-GBA01        PIC 9(2).              
         10 INTERV-MAX-GBA01        PIC X(6).              
         10 FILLER REDEFINES INTERV-MAX-GBA01.             
            15 HH-MAX-GBA01         PIC 9(2).              
            15 MM-MAX-GBA01         PIC 9(2).              
            15 SS-MAX-GBA01         PIC 9(2).              
         10 LIMITE-MAX-GBA01 REDEFINES INTERV-MAX-GBA01.   
            15 HH-LIM-MAX-GBA01     PIC 9(2).              
            15 MM-LIM-MAX-GBA01     PIC 9(2).              
            15 SS-LIM-MAX-GBA01     PIC 9(2).              
         10 FILLER                  PIC X(61).             
      05 ÁREA-SALIDA-GBA01          PIC X(150).            
      05 FILLER REDEFINES ÁREA-SALIDA-GBA01.               
         10 RESULTADO-GBA01         PIC 9(2).              
          10 RAZON-GBA01             PIC 9(4).                 
          10 EST-SES-PRESENT-GBA01   PIC 9(3).                 
          10 EST-CARGA-CSB-GBA01     PIC 9(3).                 
          10 PRESENT-DEFINIDA-GBA01  PIC X(1).                 
          10 NUM-SESION-GBA01        PIC 9(4).                 
          10 FECHA-INICIO-PRES-GBA01 PIC X(14).                
          10 FILLER REDEFINES FECHA-INICIO-PRES-GBA01.         
             15 WFECH-INI-PRES-GBA01 PIC X(8).                 
             15 WHORA-INI-PRES-GBA01 PIC X(6).                 
          10 FECHA-FIN-PRES-GBA01    PIC X(14).                
          10 FILLER REDEFINES FECHA-FIN-PRES-GBA01.            
             15 WFECH-FIN-PRES-GBA01 PIC X(8).                 
             15 WHORA-FIN-PRES-GBA01 PIC X(6).                 
          10 FECHA-INICIO-PROC-GBA01 PIC X(14).                
          10 FECHA-FIN-PROC-GBA01    PIC X(14).                
          10 INTERV-EJ-GBA01         PIC 9(08).                
          10 FILLER                  PIC X(69).               
 
*                                                                 

  PROCEDURE DIVISION.                              
 
 *                                                                 
  N1-P-PROGRAMA.                                                   
 *                                                                 
 *                                                          
     MOVE LOW-VALUES               TO ÁREA-GBA01   
     MOVE 01                       TO FUNCION-GBA01.
     MOVE ‘E’                      TO SENTIDO-GBA01.
     MOVE ‘000099990’              TO LOCAL-GBA01
     MOVE ‘000099940’              TO REMOTO-GBA01
     MOVE ‘PRUEBA’                 TO APLICACION-GBA01  
 * INTERVALOS DE WAIT CADA 5 MINUTOS Y MEDIO.
 * INTERVALO MAXIMO DE ESPERA: 31 HORAS, 59 MINUTOS, 14 SEGUNDOS       
     MOVE 000530                   TO INTERV-WAIT-GBA01
     MOVE 315914                   TO INTERV-MAX-GBA01
     MOVE ÁREA-ENTRADA-GBUTC       TO ÁREA-ENTRADA-GBA01.  
 *                                                          
     CALL  ZTBGBA01  USING ÁREA-GBA01.                     
 *
     IF RESULTADO-GBA01 = ZEROS OR 07
        IF ESTADO-PRESENTACION-GBA01 = 005
           DISPLAY ‘FINALIZADO’
 * AQUI SE PODRIAN REALIZAR LAS ACCIONES DESEADAS 
        ELSE
           DISPLAY ‘ ESTADO :’ ESTADO-PRESENTACION-GBA01
     ELSE
        NEXT SENTENCE.
 *                                                             
     MOVE RESULTADO-GBA01        TO RETURN-CODE.           

```


---

# 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-comun-z-os/interfaces-de-programas-de-aplicacion/consulta-del-estado-de-presentacion/ejemplo.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.
