> 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/firma-electronica/funciones-batch-de-onesait-editran-ff.md).

# Funciones batch de Onesait Editran/FF

Editran/FF realiza las operaciones de firma y verificación a través de procedimientos batch que usualmente se asocian al procedimiento previo a emisión y posterior a recepción de Editran.

## Procedimientos de Onesait Editran/FF <a href="#toc8743202" id="toc8743202"></a>

Los procedimientos que se suministran y que se pondrán en la sesión de presentación que requiera la firma de ficheros son:

* **ZTBFP1 – Paso A1P: carga/envío de los ficheros firmados**

> **Paso01: firma de ficheros**

```cobol
//      PROC ORIGEN=,FUNCION=,L0=L00,                                  
//           L1=,L2=,R1=,R2=,AP=,PR=,LF=S,FV=F                         
//*--------------------------------------------------------------------
//* INDRA *                                                            
//*--------------------------------------------------------------------
//*   PROCEDIMIENTO PREVIO A LA EMISION DE EDITRAN/FF                 *
//*--------------------------------------------------------------------
//* EDITRAN/G                                                          
//*  DATOS:                                                           *
//*      ORIGEN (O=OPERADOR,E=EDITRAN,A=JCL APLICACION) --->  1 BYTE  *
//*                                                                   *
//*      FUNCION (01=CARGA DE EMISION DE PRESENTACION,                *
//*               03=EMISION DE PRESENTACION)          ---->  2 BYTES *
//*                                                                   *
//*      SESION-PRESENTACION:                                         *
//*        CODIGO LOCAL L1  ------------------------------->  6 BYTES *
//*                     L2  ------------------------------->  3 BYTES *
//*        REMOTO       R1  ------------------------------->  6 BYTES *
//*                     R2  ------------------------------->  3 BYTES *
//*        APLICACION   PR  ------------------------------->  6 BYTES *
//*                                                                   *
//*      SESION-TRASMISION (EDITRAN/P):                               *
//*        APLICACION   AP  ------------------------------->  6 BYTES *
//*                                                  TOTAL = 33 BYTES *
//*      LISTA FICHEROS (S) OBLIGATORIA:                               
//*                     LF  --------------------------------> 1 BYTE  *
//*      ALIAS ENTORNO LOCAL (PARA USOS PARTICULARES)                 *
//*                     L0  --------------------------------> 3 BYTES  
//*                                                                    
//* EDITRAN/FF                                                         
//*      FIRMA DE DATOS (F=FIRMA FICHEROS, V=VERIFICA FIRMA)           
//*                     FV  --------------------------------> 1 BYTE   
//*--------------------------------------------------------------------
//* PASO01- PASO DE FIRMA DE FICHEROS).                                
//* SI LEE LA SESION Y NO SE TRATA DE SESION FF, ACABA CON RC=01       
//*--------------------------------------------------------------------
//*--------------------------------------------------------------------
//PASO01 EXEC PGM=ZTBFBEFF,                                            
//             PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&AP&FV&PR/CBLQ(ON)',   
//             REGION=0M,TIME=1440                                     
//*TEPLIB   DD DSN=KI.EGDI.ZTBP.LOADE,DISP=SHR                         
//STEPLIB   DD DSN=KI.EIDA.LOAD,DISP=SHR                               
//          DD DSN=KI.EGDI.LOAD,DISP=SHR                               
//          DD DSN=IMSP.SDFSRESL,DISP=SHR                              
//SYSTCPD   DD DSN=SW.TCPIP.SEZAPARM(TCPDATB4),DISP=SHR                
//ZTBFF032  DD DSN=KI.EGDI.ZTBF.JCLS(ZTBFF032),DISP=SHR                
//ZTBFFLOG  DD SYSOUT=*                                                
//SYSOUT    DD SYSOUT=*                                                
//SYSPRINT  DD SYSOUT=*                                                
//CEEDUMP   DD SYSOUT=*                                                
//ZTBGFCAR  DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBGFCAR,DISP=SHR    
//ZTBFFCAR  DD DSN=&&ZTBFFCAR,DISP=(NEW,PASS,DELETE),                  
//             DCB=(RECFM=FB,LRECL=80),                                
//             SPACE=(TRK,(500,50),RLSE)                               
//*--------------------------------------------------------------------
//* A1P. CARGA DE EDITRAN                                              
//*--------------------------------------------------------------------
//A1P     EXEC PGM=ZTBGB110,COND=(0,NE),REGION=0M,TIME=1440,           
//             PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&PR&AP&LF/CBLQDA(ON)'  
//*TEPLIB   DD DSN=KI.EGDI.ZTBP.LOADE,DISP=SHR                         
//STEPLIB   DD DSN=KI.EIDA.LOAD,DISP=SHR                               
//          DD DSN=KI.EGDI.LOAD,DISP=SHR                               
//          DD DSN=IMSP.SDFSRESL,DISP=SHR                              
//          DD DSN=KI.EGDC.ZTBP.LOAD.ICSF,DISP=SHR                     
//ZTBGFLOG  DD SYSOUT=*                                                
//ZTBGF032  DD DSN=KI.EGDI.ZTBG.ZTBGF032,DISP=SHR                      
//ZTBGFLIS  DD SYSOUT=*                                                
//ZTBGFMSJ  DD SYSOUT=*                                                
//ZTBGFPRI  DD SYSOUT=*,DCB=(BLKSIZE=105)                              
//ZTBGFINT  DD SYSOUT=(H,INTRDR),DCB=(BLKSIZE=80)                      
//ZTBGFTCO  DD DSN=KI.EGDI.ZTBG.ZTBGFTCO,DISP=SHR                      
//CEEDUMP   DD SYSOUT=*                                                
//SYSOUT    DD SYSOUT=*                                                
//ZTBGFCAR  DD DSN=&&ZTBFFCAR,DISP=(OLD,PASS,DELETE)                   
//*                                                                    
//      SET LOCAL0=&L0                          
```

* **ZTBFP4 – Paso A4P: descarga de los ficheros recibidos**

> Paso01: verificación de los ficheros firmados
>
> Paso02: adaptación del fichero de datos una vez separado de la firma

```cobol
//      PROC ORIGEN=,FUNCION=,L0=L00,                                  
//           L1=,L2=,R1=,R2=,AP=,PR=,FV=V,LF=                          
//      SET LF=N                                                       
//*                                                                    
//*--------------------------------------------------------------------
//*   PROCEDIMIENTO POSTERIOR A LA RECEPCION DE EDITRAN/FF            *
//*--------------------------------------------------------------------
//*  DATOS:                                                           *
//*      ORIGEN (O=OPERADOR,E=EDITRAN,A=JCL APLICACION) ----> 1 BYTE  *
//*                                                                   *
//*      FUNCION (07=DESCARGA DE RECEPCION DE PRESENTACION            *
//*               09=FIN DE RECEPCION DE PRESENTACION ) ----> 2 BYTES *
//*                                                                   *
//*      SESION-PRESENTACION  :                                       *
//*        CODIGO LOCAL L1  --------------------------------> 6 BYTES *
//*                     L2  --------------------------------> 3 BYTES *
//*        REMOTO       R1  --------------------------------> 6 BYTES *
//*                     R2  --------------------------------> 3 BYTES *
//*        APLICACION   PR  --------------------------------> 6 BYTES *
//*                                                                   *
//*      SESION-TRANSMISION  (EDITRAN/P):                             *
//*        APLICACION   AP  --------------------------------> 6 BYTES *
//*                                                  TOTAL = 33 BYTES *
//*      ALIAS ENTORNO LOCAL (PARA USOS PARTICULARES)                 *
//*                     L0  --------------------------------> 3 BYTES *
//* EDITRAN/FF                                                         
//*      FIRMA DE DATOS (F=FIRMA FICHEROS, V=VERIFICA FIRMA)           
//*                     FV  --------------------------------> 1 BYTE   
//*--------------------------------------------------------------------
//A4P      EXEC PGM=ZTBGB140,REGION=0M,TIME=1440,                      
//          PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&PR&AP/CBLQDA(ON)'        
//*TEPLIB   DD DSN=KI.EGDI.ZTBP.LOADE,DISP=SHR                         
//STEPLIB   DD DSN=KI.EIDA.LOAD,DISP=SHR                               
//          DD DSN=KI.EGDI.LOAD,DISP=SHR                               
//          DD DSN=IMSP.SDFSRESL,DISP=SHR                              
//          DD DSN=KI.EGDC.ZTBP.LOAD.ICSF,DISP=SHR                     
//ZTBGFLOG DD SYSOUT=*                                                 
//ZTBGF032 DD DSN=KI.EGDI.ZTBG.ZTBGF032,DISP=SHR                       
//ZTBGFLIS DD SYSOUT=*                                                 
//ZTBGFMSJ DD SYSOUT=*                                                 
//ZTBGFPRI DD SYSOUT=*,DCB=(BLKSIZE=105)                               
//ZTBGFTCO DD DSN=KI.EGDI.ZTBG.ZTBGFTCO,DISP=SHR                       
//SYSOUT   DD SYSOUT=*                                                 
//SYSPRINT DD SYSOUT=*                                                 
//CEEDUMP  DD SYSOUT=*                                                 
//ZTBGFINT DD SYSOUT=(H,INTRDR),DCB=(BLKSIZE=80)                       
//      SET LOCAL0=&L0                                                 
//*--------------------------------------------------------------------
//*PASO VALIDO PARA FF. BORRA LA LISTA DE SALIDA CON RESULTADO DE VERI-
//*FICACION DE LA FIRMA                                                
//*********************************************************************
//INBORR0  EXEC PGM=IEFBR14                                            
//LISTAFL  DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBGFLFE,             
//        DISP=(MOD,DELETE,DELETE),SPACE=(TRK,(1,1),RLSE)              
//LISTAFS  DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFSAL,             
//        DISP=(MOD,DELETE,DELETE),SPACE=(TRK,(1,1),RLSE)              
//LISTAF2  DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFLF2,             
//        DISP=(MOD,DELETE,DELETE),SPACE=(TRK,(1,1),RLSE)              
//LISTAR1  DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFR12,             
//        DISP=(MOD,DELETE,DELETE),SPACE=(TRK,(1,1),RLSE)              
//*--------------------------------------------------------------------
//* PASO PARA SACAR LISTA DE FICHEROS RECIBIDOS                       *
//*--------------------------------------------------------------------
//ZTBGLFE EXEC PGM=ZTBGBLFE,REGION=4M,COND=(0,NE),                     
//             PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&PR&AP/CBLQDA(ON)'     
//*TEPLIB   DD DSN=KI.EGDI.ZTBP.LOADE,DISP=SHR                         
//STEPLIB   DD DSN=KI.EIDA.LOAD,DISP=SHR                               
//          DD DSN=KI.EGDI.LOAD,DISP=SHR                               
//          DD DSN=IMSP.SDFSRESL,DISP=SHR                              
//ZTBGF032  DD DSN=KI.EGDI.ZTBG.ZTBGF032,DISP=SHR                      
//ZTBGFLOG  DD SYSOUT=*                                                
//ZTBGFPRI  DD SYSOUT=*,DCB=(BLKSIZE=105)                              
//SYSOUT    DD SYSOUT=*                                                
//ZTBGFLFE  DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBGFLFE,            
//             DISP=(NEW,CATLG,DELETE),                                
//             SPACE=(TRK,(5,1),RLSE),                                 
//             DCB=(RECFM=FB,LRECL=200,BLKSIZE=0,DSORG=PS)             
//*--------------------------------------------------------------------
//PASSORT  EXEC PGM=SORT,COND=(0,NE)                                   
//SORTIN    DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBGFLFE,DISP=SHR    
//SORTOUT   DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFLFT,            
//             DISP=(NEW,PASS,DELETE),                                 
//             DCB=(RECFM=FB,LRECL=200,BLKSIZE=0),                     
//             SPACE=(TRK,(1,1),RLSE)                                  
//SYSOUT    DD SYSOUT=*                                                
//SYSABOUT  DD SYSOUT=*                                                
//SYSIN     DD DSN=KI.EGDI.ZTBF.JCLS(ZTBFFSOR),DISP=SHR                
//*--------------------------------------------------------------------
//* PASO01- PASO DE VERIF.FIRMA                                        
//* SI LEE LA SESION Y NO SE TRATA DE SESION FF, ACABA CON RC=01       
//*--------------------------------------------------------------------
//PASO01   EXEC PGM=ZTBFBEFF,COND=(0,NE),                              
//         PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&AP&FV&PR/CBLQDA(ON)',     
//         REGION=0M,TIME=1440                                         
//*TEPLIB   DD DSN=KI.EGDI.ZTBP.LOADE,DISP=SHR                         
//STEPLIB   DD DSN=KI.EIDA.LOAD,DISP=SHR                               
//         DD DSN=KI.EGDI.LOAD,DISP=SHR                                
//         DD DSN=IMSP.SDFSRESL,DISP=SHR                               
//ZTBFF032 DD DSN=KI.EGDI.ZTBF.JCLS(ZTBFF032),DISP=SHR                 
//ZTBGFLIS DD SYSOUT=*                                                 
//ZTBGFMSJ DD SYSOUT=*                                                 
//ZTBGFPRI DD SYSOUT=*,DCB=(BLKSIZE=105)                               
//ZTBFFLOG DD SYSOUT=*                                                 
//SYSTCPD  DD DSN=SW.TCPIP.SEZAPARM(TCPDATAB),DISP=SHR                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSPRINT DD   SYSOUT=*,OUTLIM=999999                                 
//CEEDUMP  DD SYSOUT=*                                                 
//*ZTBFFTMP DD DSN=KI.EGDI.ZTBFFTMP,DISP=SHR                           
//ZTBGFLFE DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFLFT,DISP=SHR     
//ZTBFFLF2 DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFLF2,             
//         DISP=(NEW,CATLG,DELETE),                                    
//         SPACE=(TRK,(1,1),RLSE),                                     
//         DCB=(RECFM=FB,LRECL=300,BLKSIZE=0,DSORG=PS)                 
//ZTBFFSAL DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFSAL,             
//         DISP=(NEW,CATLG,DELETE),                                    
//         SPACE=(TRK,(1,1),RLSE),                                     
//         DCB=(RECFM=VB,LRECL=1081,BLKSIZE=0,DSORG=PS)                 
//ZTBFFP12 DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFR12,             
//         DISP=(NEW,CATLG,DELETE),                                    
//         DCB=(RECFM=FB,LRECL=80,BLKSIZE=80),                         
//         SPACE=(TRK,(1,1),RLSE)                                      
//*                                                                    
//*--------------------------------------------------------------------
//* PASO02- PASO DE FORMATEADO DE FICHERO                              
//*--------------------------------------------------------------------
//* IF (PASO01.RC<2) THEN                                              
//* INBORR1  EXEC PGM=IEFBR14                                          
//* LISTAFF  DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBGFLFE,           
//*         DISP=(OLD,DELETE,DELETE)                                   
//* ENDIF                                                              
//PASO02   EXEC PGM=ZTBFBR12,PARM='/CBLQDA(ON)',                       
//         REGION=0M,TIME=1440,COND=(0,NE)                             
//STEPLIB  DD DSN=IMSP.SDFSRESL,DISP=SHR                               
//         DD DSN=KI.EIDA.LOAD,DISP=SHR                                
//         DD DSN=KI.EGDI.LOAD,DISP=SHR                                
//IMSACB   DD DSN=KI.EGDI.ACBLIB,DISP=SHR                              
//DFSVSAMP DD DSN=IMSP.PROCLIB(DFSVSAMP),DISP=SHR                      
//ZTBFF032 DD DSN=KI.EGDI.ZTBF.JCLS(ZTBFF032),DISP=SHR                 
//ZTBGFTCO DD DSN=KI.EGDI.ZTBG.ZTBGFTCO,DISP=SHR                       
//ZTBGFLIS DD SYSOUT=*                                                 
//ZTBGFMSJ DD SYSOUT=*                                                 
//ZTBGFPRI DD SYSOUT=*,DCB=(BLKSIZE=105)                               
//ZTBFFLOG DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//CEEDUMP  DD SYSOUT=*                                                 
//ZTBFFLF2 DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFLF2,DISP=SHR     
//ZTBFFSAL DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFSAL,             
//         DISP=SHR                                                    
//ZTBGFLFE DD SYSOUT=*                                                 
//SYSIN    DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFR12,DISP=SHR     
//*ENDIF                                                               
//*                                                                    
// IF (PASO02.RC=0) THEN                                               
//INBORR2  EXEC PGM=IEFBR14                                            
//LISTAF2  DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFLF2,             
//         DISP=(OLD,DELETE,DELETE)                                    
// ENDIF                                                               
//*                                                                    
// IF (PASO02.RC=0) THEN                                               
//INBORR3  EXEC PGM=IEFBR14                                            
//LISTAFS  DD DSN=KI.EGDI.&L0..R&R1..R&R2..A&PR..ZTBFFR12,             
//         DISP=(OLD,DELETE,DELETE)                                    
// ENDIF                                                               
```

Los resultados más significativos con los que pueden finalizar los procesos de tratamiento de firma son:

<table data-header-hidden><thead><tr><th width="70" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">RDO</td><td valign="top">Comentario</td></tr><tr><td valign="top">01</td><td valign="top">Verificación de firma con errores, se debe revisar el fichero ZTBFFSAL</td></tr><tr><td valign="top">06</td><td valign="top">No se requiere realizar el proceso de adaptación de ficheros</td></tr><tr><td valign="top">08</td><td valign="top">Error en verificación de firma: DOCUMENTO MODIFICADO</td></tr><tr><td valign="top">13</td><td valign="top">Error al abrir un fichero en MVS</td></tr><tr><td valign="top">14</td><td valign="top">Error al cerrar un fichero en MVS</td></tr><tr><td valign="top">15</td><td valign="top">Error al leer un fichero en MVS</td></tr><tr><td valign="top">16</td><td valign="top">Error al escribir en un fichero en MVS</td></tr><tr><td valign="top">17</td><td valign="top">Error al rescribir en un fichero en MVS</td></tr><tr><td valign="top">18</td><td valign="top">Error al borrar el fichero</td></tr><tr><td valign="top">19</td><td valign="top">Error al alocar un fichero</td></tr><tr><td valign="top">20</td><td valign="top">Error al desalocar un fichero</td></tr><tr><td valign="top">21</td><td valign="top">Parámetros de entrada incorrectos</td></tr><tr><td valign="top">22</td><td valign="top">Error al acceder a la B.D.</td></tr><tr><td valign="top">23</td><td valign="top">No hay ningún fichero de aplicación catalogado.</td></tr><tr><td valign="top">24</td><td valign="top">Número de ficheros de aplicación excede del máximo permitido</td></tr><tr><td valign="top">25</td><td valign="top">Fichero de aplicación no catalogado.</td></tr><tr><td valign="top">26</td><td valign="top">No existe registro de entorno en EDITRAN/FF</td></tr><tr><td valign="top">27</td><td valign="top">No existe aplicación en EDITRAN/FF</td></tr><tr><td valign="top">28</td><td valign="top">No existe sesión de presentación en EDITRAN</td></tr><tr><td valign="top">37</td><td valign="top"><p>Error en el servicio de firma.</p><p>Posible error de comunicación (revise mensajes en SYSOUT)</p></td></tr><tr><td valign="top">38</td><td valign="top">La aplicación de envío de ficheros firmados no tiene asociado ningún usuario que pueda firmar</td></tr><tr><td valign="top">39</td><td valign="top">Lista de ficheros de entrada vacía.</td></tr><tr><td valign="top">42</td><td valign="top">Error de catalogación</td></tr><tr><td valign="top">43</td><td valign="top">No existen usuarios locales que puedan firmar los envíos</td></tr><tr><td valign="top">45</td><td valign="top">Error en el proceso servidor al generar la firma</td></tr><tr><td valign="top">46</td><td valign="top">Error en el proceso servidor al validar la firma</td></tr><tr><td valign="top">47</td><td valign="top">Error al validar la firma</td></tr><tr><td valign="top">48</td><td valign="top">No se han encontrado todos los signatarios requeridos</td></tr><tr><td valign="top">49</td><td valign="top">No se han implementado reglas de validación de firmantes</td></tr><tr><td valign="top">51</td><td valign="top">Con tipo de firma ‘D’, no encuentra el fichero de Datos</td></tr><tr><td valign="top">52</td><td valign="top">Con tipo de firma ‘D’, no encuentra el fichero de Firma</td></tr><tr><td valign="top">53</td><td valign="top">No se puede realizar contrafirma en modo PKCS#7</td></tr><tr><td valign="top">55</td><td valign="top">Parámetro delimitadores erróneo en aplicación EDITRAN/FF</td></tr><tr><td valign="top">56</td><td valign="top">Error delimitadores de registro no coinciden</td></tr><tr><td valign="top">58</td><td valign="top">Errores en la configuración del perfil de aplicación EDITRAN/FF</td></tr><tr><td valign="top">61</td><td valign="top">No existe usuario local para realizar la contrafirma</td></tr><tr><td valign="top">65</td><td valign="top">El fichero de aplicación existe y no está permitido borrarlo</td></tr></tbody></table>

## Fichero de salida a la aplicación <a href="#toc8743203" id="toc8743203"></a>

Se crea fichero (ZTBFFSAL) FB de 300. Indicará como fue la verificación de firmas para cada fichero recibido, así como características de las firmas. Tiene 2 tipos de registros:

<table data-header-hidden><thead><tr><th width="65" valign="top"></th><th width="230" valign="top"></th><th width="71" align="center" valign="top"></th><th width="70" align="center" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Nivel</td><td valign="top">Nombre</td><td align="center" valign="top">Long.</td><td align="center" valign="top">Fmto.</td><td valign="top">Descripción</td></tr><tr><td valign="top">1</td><td valign="top">Registro ZTBFFSAL</td><td align="center" valign="top"></td><td align="center" valign="top">Alfn.</td><td valign="top">Registros de TIPO 01.</td></tr><tr><td valign="top">2</td><td valign="top">Tipo de registros</td><td align="center" valign="top">2</td><td align="center" valign="top">Alfn.</td><td valign="top">01-Registros referentes a ficheros tratados y a su resultado de validación</td></tr><tr><td valign="top">2</td><td valign="top">Dos puntos</td><td align="center" valign="top">1</td><td align="center" valign="top">Alfn.</td><td valign="top">Valor: ‘:’</td></tr><tr><td valign="top">2</td><td valign="top">Código de retorno</td><td align="center" valign="top">4</td><td align="center" valign="top">Num</td><td valign="top"><p>0000- Verificación de la firma correctamente</p><p>0012- Autoridad certificadora no válida</p><p>0013- Certificado(s) revocado(s). No implementado aún</p><p>0014- Certificado(s) caducado(2)</p><p>0015- Documento modificado</p><p>0016- Firmante(s) no autorizado(s) en la cuenta según los perfiles proporcionados en el administrador de Editran/FF</p></td></tr><tr><td valign="top">2</td><td valign="top">Dos puntos</td><td align="center" valign="top">1</td><td align="center" valign="top">Alfn.</td><td valign="top">Valor: ‘:’</td></tr><tr><td valign="top">2</td><td valign="top">Dsname Formateado final</td><td align="center" valign="top">44</td><td align="center" valign="top">Alfn.</td><td valign="top">Dsname del fichero formateado y traducido final, a tratar por la aplicación.</td></tr><tr><td valign="top">2</td><td valign="top">Dos puntos</td><td align="center" valign="top">1</td><td align="center" valign="top">Alfn.</td><td valign="top">Valor: ‘:’</td></tr><tr><td valign="top">2</td><td valign="top">Dsname descargado ASCII</td><td align="center" valign="top">44</td><td align="center" valign="top">Alfn.</td><td valign="top">Dsname del fichero ASCII, extraído del XML y con las firmas también extraídas.</td></tr><tr><td valign="top">2</td><td valign="top">Dos puntos</td><td align="center" valign="top">1</td><td align="center" valign="top">Alfn.</td><td valign="top">Valor: ‘:’</td></tr><tr><td valign="top">2</td><td valign="top">Dsname descargado por Editran</td><td align="center" valign="top">44</td><td align="center" valign="top">Alfn.</td><td valign="top">Dsname del fichero descargado por Editran, cuyo contenido es el XML que se ha tratado.</td></tr><tr><td valign="top">2</td><td valign="top">Dos puntos</td><td align="center" valign="top">1</td><td align="center" valign="top">Alfn.</td><td valign="top">Valor: ‘:’</td></tr><tr><td valign="top">2</td><td valign="top">Mensaje de error</td><td align="center" valign="top">80</td><td align="center" valign="top">Alfn.</td><td valign="top"><p>Mensaje</p><p>Si rc=0000, Proceso de firma correcto (sin mensaje)</p><p>Si rc=xxxx, mensaje de error oportuno</p></td></tr><tr><td valign="top">2</td><td valign="top">Area reserva</td><td align="center" valign="top">77</td><td align="center" valign="top">Alfn.</td><td valign="top">Area de reserva</td></tr></tbody></table>

<table data-header-hidden><thead><tr><th width="70" valign="top"></th><th width="230" valign="top"></th><th width="70" align="center" valign="top"></th><th width="70" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Nivel</td><td valign="top">Nombre</td><td align="center" valign="top">Long.</td><td valign="top">Fmto.</td><td valign="top">Descripción</td></tr><tr><td valign="top">1</td><td valign="top">Registro ZTBFFSAL</td><td align="center" valign="top"></td><td valign="top">Alfn.</td><td valign="top">Registros de TIPO 02.</td></tr><tr><td valign="top">2</td><td valign="top">Tipo de registros</td><td align="center" valign="top">2</td><td valign="top">Alfn.</td><td valign="top">02-Registros referentes a firmantes por fichero. Por cada registro tipo 1, habrá tantos registros de tipo 2, como firmantes contenga el fichero firmado.</td></tr><tr><td valign="top">2</td><td valign="top">Dos puntos</td><td align="center" valign="top">1</td><td valign="top">Alfn.</td><td valign="top">Valor: ‘:’</td></tr><tr><td valign="top">2</td><td valign="top">Area de reserva</td><td align="center" valign="top">4</td><td valign="top">Alfn.</td><td valign="top"></td></tr><tr><td valign="top">2</td><td valign="top">Dos puntos</td><td align="center" valign="top">1</td><td valign="top">Alfn.</td><td valign="top">Valor: ‘:’</td></tr><tr><td valign="top">2</td><td valign="top">Dsname Formateado final</td><td align="center" valign="top">44</td><td valign="top">Alfn.</td><td valign="top">Dsname del fichero formateado y traducido final, a tratar por la aplicación.</td></tr><tr><td valign="top">2</td><td valign="top">Dos puntos</td><td align="center" valign="top">1</td><td valign="top">Alfn.</td><td valign="top">Valor: ‘:’</td></tr><tr><td valign="top">2</td><td valign="top">Datos del DN firmante</td><td align="center" valign="top">247</td><td valign="top">Alfn.</td><td valign="top"></td></tr></tbody></table>

## Incorporación del DN Remoto

Para facilitar la cumplimentación del DN de un certificado remoto, que actualmente se realiza a través de la pantalla, se ha creado un JCL que lo incorpora desde un fichero que lo contenga, ZTBFJCDN.

```cobol
//KI88D46A JOB (EGDI,KIT,,99),'EDITRAN/FF ',MSGCLASS=H,CLASS=A,        
//            NOTIFY=&SYSUID                                           
//LIBPROC JCLLIB  ORDER=IMST.PROCLIB                                   
//*********************************************************************
//* PGM QUE LANZA EL PGM ZTBFECDN - MODIFICACION DE DN PERFIL USUARIO *
//*********************************************************************
//*********************************************************************
//*  DATOS de entrada:                                                 
//*        fichero con el DN: ZTBFFCDN                                 
//*        SYSIN: Remoto y Nombre de Usuario                           
//*********************************************************************
//ZTBFECDN EXEC IMSBATCH,MBR=ZTBFECDN,PSB=ZTBFEGPF,REGION=0M           
//STEPLIB   DD DSN=KI.EGTI.LOAD,DISP=SHR                               
//ZTBFFCDN  DD DSN=KI.EIDA.DN,DISP=SHR                                 
//SYSOUT    DD SYSOUT=*                                                
//SYSPRINT  DD SYSOUT=*                                                
//PRINTDD   DD SYSOUT=*                                                
//SYSIN     DD *                                                       
000099990UsRemoto                                                      
//*                 
```

Los datos de entrada son:

* SYSIN: Código Remoto y nombre del Usuario Remoto propietario del certificado
* Fichero que contiene el DN: formato VB y longitud de registro 1028 (ZTBFFCDN).

Este fichero es el que se proporcionará en el script obtén\_dn.sh para guardar el DN del certificado.

## Fichero de salida JSON

Se crea fichero (ZTBFFJSN) VB de 396. Este fichero es el resultado de la recepción de una presentación. La información que contiene es referente a dicha recepción. Por tanto, vendrá informada la aplicación (sesión de presentación), el número de firmas obligatorias, los grupos y los usuarios.

La nomenclatura del fichero es la siguiente:

PrefInstalacion.JobName.JobId.BRx. ZTBFFJSN

<table data-header-hidden><thead><tr><th width="65" valign="top"></th><th width="140" valign="top"></th><th width="70" align="center" valign="top"></th><th width="70" align="center" valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top">Nivel</td><td valign="top"></td><td align="center" valign="top">Long.</td><td align="center" valign="top">Fmto.</td><td valign="top">Descripción</td></tr><tr><td valign="top"></td><td valign="top">PrefInstalacion</td><td align="center" valign="top">11</td><td align="center" valign="top">Alfn.</td><td valign="top">Es el prefijo de la instalación del entorno local de EDITRAN/FF</td></tr><tr><td valign="top"></td><td valign="top">JobName</td><td align="center" valign="top">8</td><td align="center" valign="top">Alfn.</td><td valign="top">Nombre del JOB (ej. KIEDRCT7)</td></tr><tr><td valign="top"></td><td valign="top">JobId</td><td align="center" valign="top">8</td><td align="center" valign="top">Alfn.</td><td valign="top">Id del JOB que se lanza (ej. JOB03039)</td></tr><tr><td valign="top"></td><td valign="top">BRx</td><td align="center" valign="top">3</td><td align="center" valign="top">Alfn.</td><td valign="top"><p>La x puede tomar tres valores diferentes 1, 2 o 3 dependiendo del modo de firma:</p><p>1. Attached</p><p>2. Detached</p><p>3. Concatenado</p></td></tr></tbody></table>


---

# 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/firma-electronica/funciones-batch-de-onesait-editran-ff.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.
