> 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-en/interfaz-generica-de-aplicacion/anexo-b.-programas-y-exit-de-usuario/autooperador-batch.md).

# Batch auto-operator

## General description <a href="#toc149819083" id="toc149819083"></a>

A user program has been created, which can be included in profiles or called from the user programs themselves, and which allows, among other things, linking with the entity schedulers and launching JCLs or procedures. As a result of incorporating this new functionality, the step area to the user program in the case of A7I has been modified, so that the presentation session is passed instead of the transmission session.

That program is ZTBGBUOP, which reads a file containing the request list, called installation prefix-ZTBGFUSU, flat 200-byte file.

## Input/output elements <a href="#toc149819084" id="toc149819084"></a>

Communication area: passed by the invoking Editran programs. Its content was specified in the user program.

File used in the program (ZTBGFUSU), created by the user, whose format is specified below:

```cobol
01  REG-FUSU.                                       
     03 REG-200-FUSU                   PIC X(200).   
     03 REG-CGO-A7I-FUSU REDEFINES REG-200-FUSU.     
        05 EMI-REC-FUSU               PIC X(3).      
        05 FILLER                     PIC X.         
        05 CGOS-FUSU OCCURS 36.                      
           10 CGO-A7I-FUSU            PIC X(3).      
           10 FILLER                  PIC X.         
        05 FILLER                     PIC X(52).     
     03 REG-PETICIONES-FUSU REDEFINES REG-200-FUSU.  
        05 PETICION-E-FUSU            PIC X(40).     
        05 FILLER REDEFINES PETICION-E-FUSU.         
           10 FUNCION-E-FUSU          PIC X(02).     
           10 SESION-PRES-E-FUSU.                    
              15 LOCAL-E-FUSU         PIC X(9).      
              15 REMOTO-E-FUSU        PIC X(9).      
              15 APLICACION-E-FUSU    PIC X(6).      
           10 REFERENCIA-A7I-E-FUSU.                  
              15 EMI-REC-A7I-E-FUSU   PIC X.
              15 CGO-A7I-E-FUSU       PIC X(03).
           10 FILLER                  PIC X(10).
        05 PETICION-S-FUSU            PIC X(160).
        05 FILLER REDEFINES PETICION-S-FUSU.    
           10 FUNCION-S-FUSU          PIC X(02).
           10 SESION-PRES-S-FUSU.               
              15 LOCAL-S-FUSU         PIC X(9). 
              15 REMOTO-S-FUSU        PIC X(9). 
              15 APLICACION-S-FUSU    PIC X(6). 
           10 HORA-INI-FUSU           PIC X(4). 
           10 HORA-FIN-FUSU           PIC X(4). 
           10 COD-RET-S-FUSU          PIC 9(4). 
           10 FILLER REDEFINES COD-RET-S-FUSU.           
              15 NRO-REINT-FUSU       PIC 9(4).          
           10 NFUNCION-S-FUSU         PIC X(02).         
           10 UBICACION-S-FUSU        PIC X(44).         
           10 FILLER REDEFINES UBICACION-S-FUSU.         
              15 TIEMPO-WAIT-FUSU     PIC 9(8).          
              15 FILLER               PIC X(36).         
           10 FILLER                  PIC X(76).
          
```

<table data-header-hidden><thead><tr><th width="62.08642578125" valign="top"></th><th width="176.92608642578125" valign="top"></th><th width="65.29638671875" valign="top"></th><th width="71.8642578125" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Level</td><td valign="top">Name</td><td valign="top">Length</td><td valign="top">Type</td><td valign="top">Description</td></tr><tr><td valign="top">1</td><td valign="top">Record of processable A7I codes.</td><td valign="top">200</td><td valign="top">Alphan.</td><td valign="top"><p>Record of A7I reference codes that will be processed by the program.</p><p>Several records of this type can be defined.</p></td></tr><tr><td valign="top">2</td><td valign="top">A7I type</td><td valign="top">3</td><td valign="top">Alphan.</td><td valign="top"><p>‘EMI’. The codes in the record are emission codes</p><p>‘REC’ The codes in the record are reception codes.</p></td></tr><tr><td valign="top">2</td><td valign="top">Filler</td><td valign="top">1</td><td valign="top">Alphan.</td><td valign="top">Separation space</td></tr><tr><td valign="top">2</td><td valign="top">A7I codes table</td><td valign="top">144</td><td valign="top">Alphan.</td><td valign="top">A7I emission or reception references table OCCURS 36 (the last 2 octets are ignored)</td></tr><tr><td valign="top">3</td><td valign="top">A7I reference</td><td valign="top">3</td><td valign="top">No.</td><td valign="top">A7I reference</td></tr><tr><td valign="top">3</td><td valign="top">Filler</td><td valign="top">1</td><td valign="top">Alphan.</td><td valign="top">Separation space</td></tr><tr><td valign="top">2</td><td valign="top">Filler</td><td valign="top">52</td><td valign="top">Alphan.</td><td valign="top">Reserve area</td></tr><tr><td valign="top">1</td><td valign="top">Input-action, output-action record</td><td valign="top">200</td><td valign="top">Alphan.</td><td valign="top">Record where the causing action and the action to be taken are entered.</td></tr><tr><td valign="top">2</td><td valign="top">Causing action</td><td valign="top">40</td><td valign="top">Alphan.</td><td valign="top">Data area reserved for the causing action</td></tr><tr><td valign="top">3</td><td valign="top">Causing function</td><td valign="top">2</td><td valign="top">No.</td><td valign="top"><p>Spaces: any action</p><p>01: Emission load</p><p>02: After emission</p><p>03: Presentation emission</p><p>05: Emission exception (interrupt emission)</p><p>06: Reception initialization</p><p>07: After reception</p><p>08: Presentation reception</p><p>09: Reception exception (interrupt reception)</p></td></tr><tr><td valign="top">3</td><td valign="top"><p>Presentation session</p><p>Causing</p></td><td valign="top">24</td><td valign="top">Alphan.</td><td valign="top">Presentation session code.</td></tr><tr><td valign="top">4</td><td valign="top"><p>Presentation origin</p><p>Causing</p></td><td valign="top">9</td><td valign="top">Alphan.</td><td valign="top"><p>Source code of the causing presentation session</p><p>Spaces: Any code is valid</p></td></tr><tr><td valign="top">4</td><td valign="top">Causing presentation destination</td><td valign="top">9</td><td valign="top">Alphan.</td><td valign="top"><p>Destination code of the causing presentation session</p><p>Spaces: Any code is valid</p></td></tr><tr><td valign="top">4</td><td valign="top"><p>Presentation application</p><p>Causing</p></td><td valign="top">6</td><td valign="top">Alphan.</td><td valign="top"><p>Causing presentation application</p><p>Spaces: Any code is valid</p></td></tr><tr><td valign="top">3</td><td valign="top"><p>A7I reference</p><p>Causing</p></td><td valign="top">4</td><td valign="top">Alphan.</td><td valign="top"><p>A7I reference specific to be processed in the request (in the case of function 05 and 09).</p><p>Spaces: Searched in the A7I record.</p></td></tr><tr><td valign="top">4</td><td valign="top"><p>A7I ref. type</p><p>Causing</p></td><td valign="top">1</td><td valign="top">Alphan.</td><td valign="top">A7I reference type (E: Emission, R: Reception).</td></tr><tr><td valign="top">4</td><td valign="top"><p>A7I ref. code</p><p>Causing</p></td><td valign="top">3</td><td valign="top">No.</td><td valign="top">A7I reference code.</td></tr><tr><td valign="top">3</td><td valign="top">Filler</td><td valign="top">10</td><td valign="top">Alphan.</td><td valign="top">Area reserved for the causing request</td></tr><tr><td valign="top">2</td><td valign="top">Action to take</td><td valign="top">160</td><td valign="top">Alphan.</td><td valign="top">Data area reserved for the action to take</td></tr><tr><td valign="top">3</td><td valign="top">Action-to-take function</td><td valign="top">2</td><td valign="top">No.</td><td valign="top"><p>01: Emission load</p><p>02: After emission</p><p>03: Presentation emission</p><p>05: Emission exception (interrupt emission)</p><p>06: Reception initialization</p><p>07: After reception</p><p>08: Presentation reception</p><p>09: Reception exception (interrupt reception)</p><p>21: Return the return code</p><p>22: Submit procedure</p><p>23: Submit JCL</p><p>24: Control of number of retries in A7I</p><p>25: Wait for a time (WAIT), before continuing with what is specified.</p></td></tr><tr><td valign="top">3</td><td valign="top">Action-to-take presentation session</td><td valign="top">24</td><td valign="top">Alphan.</td><td valign="top">Presentation session code</td></tr><tr><td valign="top">4</td><td valign="top">Action-to-take source presentation</td><td valign="top">9</td><td valign="top">Alphan.</td><td valign="top">Source code of the presentation session of the action to take.</td></tr><tr><td valign="top">4</td><td valign="top">Action-to-take destination presentation</td><td valign="top">9</td><td valign="top">Alphan.</td><td valign="top">Destination of the presentation session of the action to take.</td></tr><tr><td valign="top">4</td><td valign="top">Action-to-take presentation application</td><td valign="top">6</td><td valign="top">Alphan.</td><td valign="top">Presentation application of the action to take.</td></tr><tr><td valign="top">3</td><td valign="top">Action-to-take start time</td><td valign="top">4</td><td valign="top">No.</td><td valign="top"><p>Spaces or zeros: Do not validate start time.</p><p>HHMM: It will be validated that the action to take is after the action start time</p></td></tr><tr><td valign="top">3</td><td valign="top">Action-to-take end time</td><td valign="top">4</td><td valign="top">No.</td><td valign="top"><p>Spaces or zeros: Do not validate end time</p><p>HHMM: It will be validated that the action to take is before the action end time</p></td></tr><tr><td valign="top">3</td><td valign="top">Action-to-take return code</td><td valign="top">4</td><td valign="top">No.</td><td valign="top">Return code that the program will return. It is only used if the action to take is equal to 21</td></tr><tr><td valign="top">3</td><td valign="top">REDEFINITION</td><td valign="top"></td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top">4</td><td valign="top">Number of retries</td><td valign="top">4</td><td valign="top">No.</td><td valign="top"><p>Number of retries (0001-9999).</p><p>It is only used if the action to take is equal to 24 and it is an A7I</p></td></tr><tr><td valign="top">3</td><td valign="top">New function to take</td><td valign="top">2</td><td valign="top">No.</td><td valign="top"><p>New action to take (see action to take), if action to take = 22.</p><p>The user can set it to whatever value they want for their procedure</p></td></tr><tr><td valign="top">3</td><td valign="top">Location of the JCL of the action to take</td><td valign="top">44</td><td valign="top">Alphan.</td><td valign="top"><p>Field with variables to execute a JCL-procedure (as specified in the corresponding table). It is only used if the action to take is equal to 22 or 23.</p><p>If the action is 23, only the name of the procedure will be entered, which may be a variable name (up to 8 positions)</p></td></tr><tr><td valign="top">3</td><td valign="top">REDEFINITION</td><td valign="top"></td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top">4</td><td valign="top">Wait time</td><td valign="top">8</td><td valign="top">No.</td><td valign="top"><p>Wait or WAIT time before continuing (HHMMSSDC).</p><p>It is only used if the action to take is equal to 25 and it is an A7I</p></td></tr><tr><td valign="top">4</td><td valign="top">Filler</td><td valign="top">36</td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top">3</td><td valign="top">Filler</td><td valign="top">86</td><td valign="top">Alphan.</td><td valign="top">Area reserved for the causing request</td></tr></tbody></table>

Within the location, the job name will be 8 characters. If not, a character is generated at the end, which will be the digit of the incoming request.

To provide the location of the procedure or the JCL, the rules for putting variable pointers used to choose the reception application file name will be followed, specifically:

Allowed % variables. If the input variable does not contain a valid value, the default value is applied (since there are more allowed variables, ZTBGBUOP must ensure that only those specified below are present):

<table data-header-hidden><thead><tr><th width="73.41973876953125" valign="top"></th><th valign="top"></th><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Var</td><td valign="top">Meaning</td><td valign="top">Valid value.</td><td valign="top">Default value.</td></tr><tr><td valign="top">%Y</td><td valign="top">Last digit of the year</td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top">%A</td><td valign="top">Last two digits of the year (yy)</td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top">%M</td><td valign="top">Month in two digits (mm)</td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top">%X</td><td valign="top">Month in one character (1,2,3,4,5,6,7,8,9,O,N,D)</td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top">%D</td><td valign="top">Day of the month (dd)</td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top">%H</td><td valign="top">Time (hhmmss)</td><td valign="top"></td><td valign="top"></td></tr><tr><td valign="top">%R</td><td valign="top">The last 7 characters of the remote endpoint code</td><td valign="top">Different from spaces or x’00’</td><td valign="top">Zeros</td></tr><tr><td valign="top">%P</td><td valign="top">Application code</td><td valign="top">Different from spaces or x’00’</td><td valign="top">Zeros</td></tr></tbody></table>

## Call conditions <a href="#toc149819085" id="toc149819085"></a>

The program runs when required by the procedure main program or by the already created user program, once the complete treatment of the process has finished.

The program's input conditions vary depending on the process:

* Before output: It is invoked after loading the output buffers, regardless of whether it succeeded or not (result code = 0 or # 0).
* Before reception: After initializing the buffers.
* After output: At the end of the process of the last transmission session.
* After reception: After the data download that is triggered when the last transmission session ends.
* Exception: The program is invoked in any case.

An example is attached below in which the contents of the ZTBGFUSU file are specified:

```
EMI-010-020-021-022-023-024-150                                          
REC-030-040-050-060-070-080-090                                          
09000099980000099940PRUEBA    ----------08000099980000099940PRUEBA00002359
                          E230----------01000099980000099940PARAMI10301130
09         000099960PRUEBAR100----------21                                0029 
01000099980000099940PRUEBXR100----------22000099980000099940PARAMI            03J%R
01000099980000099940PRUEBAR100----------23000099980000099940PARAMI              KI.L%A(J%R)
```

The meaning would be:

* Entry 01: Emission A7I reference codes, which will be processed by the program.
* Entry 02: Reception A7I reference codes, which will be processed by the program.
* Entry 03: When a reception A7I of the described session arrives, 000099980000099940PRUEBA, if the A7I code belongs to those in entry 02, the reception of the presentation (function 08) of said session is requested.
* Entry 04: When any message arrives that has an emission A7I with code E230 (even if it is not in entry 02), a pre-emission will be launched, as long as the system time is between 10:30 and 11:30.
* Entry 05: When an emission load of the A7I reception session with remote-application reference R100 described above arrives, with any of the multienvironment codes of my entity, the job that is being executed will end with return code 29.
* Entry 06: When a request for an emission load of the session 000099980000099940PRUEBX arrives, a procedure called J0099940 will be generated. The following will be passed as PARM: ORIGEN='A', FUNCION='03', L0='alias of the local subenvironment', L01='000098', L2='980', R1='000094', R2='980', AP='PARAMI'.
* Entry 07: When a request for an emission load of the session 000099980000099940PRUEBA arrives, a JCL found in the KI.LPRUEBA library will be generated, and it will be called J0099940.


---

# 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-en/interfaz-generica-de-aplicacion/anexo-b.-programas-y-exit-de-usuario/autooperador-batch.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.
