> 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/editran-sepa/jcls.md).

# JCLS

The ZTBGJXML JCL is provided:

```cobol
//XXXXXXXX JOB (XXXX,XXX,,XX),ZTBXXML,MSGCLASS=X,CLASS=X,              
//             MSGLEVEL=X,NOTIFY=&SYSUID                               
//********************************************************************+
//* JCL TO CONVERT A SEPA FLAT FILE TO XML OR VICE VERSA    *+
//********************************************************************+
//* 1.-YOU MUST SET THE FOLLOWING VARIABLES:                  *+
//*   1.1.SESSION: L1+L2+R1+R2+AP: specify an Editran/G session    *+
//*   1.2.FUNCTION: FU. Accepts values X=FLAT TO XML, P=XML TO FLAT   *+
//*   1.3.TYPE: TI. Accepts values: F=FILE (the one specified in &FI=XX) *+
//*       TI=F indicates a file. &FI contains the DSNAME of the file for *+
//*            input application (XML or flat file depending on &FU)         *+
//*       TI=L indicates a list of files. &FI contains the DSNAME of a FILE *+
//*            created by the user, whose contents are the DSNAMES of *+
//*            the input files (XML or flat files depending on &FU)      *+
//*            To see the list format, see the documentation    *+
//*       TI=P indicates profiles. In this case, Editran uses the profile *+
//*            from Editran/G to obtain input file names.     *+
//*   1.4.FILE: FI.  Specify the DSNAME (max 40) &FI=XXXX    *+
//*       If &TI=F, it is the DSNAME of the input file               *+
//*       If &TI=L, it is the DSNAME of the list, whose contents are the  *+
//*                DSNAMES of the input files                *+
//*       If &TI=P, enter spaces. The job takes the files from the profile*+
//* 2.-The DD file ZTBGFDAT must exist, because its contents include *+
//*    other necessary parameters as well, IP-port, output file, *+
//*    wait time in seconds, etc. (see product documentation)      *+
//*    With &FU=X, if an output DSNAME is not specified in ZTBGFDAT,  *+
//*        the program creates an output file called DSNAME.XML     *+
//*    With &FU=P, if an output DSNAME is not specified in ZTBGFDAT,  *+
//*        the program creates an output file called:               *+
//*          DSNAME  (if the input file is DSNAME.XML)             *+
//*          DSNAME.PLN (if the input file is DSNAME)               *+
//* 3.-It outputs a list with the processed files, DD ZTBGFCAR       *+
//********************************************************************+
//      SET L1=000099                                                  
//      SET L2=940                                                      
//      SET R1=000099                                                  
//      SET R2=990                                                     
//      SET AP=CARGAC                                                  
//      SET FU=X                                                       
//      SET TI=F                                                       
//      SET FI=KI.EIDA.FF06                                            
//********************************************************************+
//INBORR1  EXEC PGM=IEFBR14                                        
//LPASO00  DD DSN=KI.PMED.R&R1..R&R2..A&AP..LISTFICX,              
//         DISP=(OLD,DELETE,DELETE)                                
//*                                                                 
//PASO01 EXEC PGM=ZTBXBXML,                                        
//      PARM='&L1&L2&R1&R2&AP&FU&TI&FI/CBLQDA(ON)'                 
//STEPLIB  DD   DSN=KI.EIDC.ZTBG.LOAD,DISP=SHR                      
//SYSTCPD  DD   DSN=SW.TCPIP.SEZAPARM(TCPDATAB),DISP=SHR           
//ZTBGFPRI DD   SYSOUT=*,DCB=(BLKSIZE=105)                         
//ZTBGFPER DD   DSN=KI.EIDC.ZTBG.ZTBGFPER,DISP=SHR 
//ZTBGFLOG DD   DSN=KI.EIDC.ZTBG.ZTBGFLOG,DISP=SHR       
//ZTBGFDAT DD   DSN=KI.EIDC.ZTBG.ZTBGFDAT,DISP=SHR                 
//ZTBGFCAR DD  DSN=KI.PMED.R&R1..R&R2..A&AP..LISTFICX,             
//            DISP=(NEW,CATLG,DELETE),                             
//            SPACE=(TRK,(500,50),RLSE),                            
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)           
//ZTBXFSAL DD  DSN=KI.PMED.R&R1..R&R2..A&AP.. ZTBXFSAL,             
//            DISP=(NEW,CATLG,DELETE),                             
//            SPACE=(TRK,(500,50),RLSE),                           
//            DCB=(RECFM=FB,LRECL=252,BLKSIZE=0,DSORG=PS)           
//SYSOUT   DD   SYSOUT=*                                           
//SYSPRINT DD   SYSOUT=*                                           
//SYSDBOUT DD   SYSOUT=*  
//ABENDAID DD   SYSOUT=*  
//SYSCOUNT DD   DUMMY     
//SYSUDUMP DD   SYSOUT=*  
//SYSABOUT DD   SYSOUT=*  
 
```

We have indicated, as an example, source (000099990), destination (000099940), application (CARGAC), Function X (flat to XML), type F (file), DSNAME of the input file = KI.FICHERO.ENTRADA

In the ZTBGFDAT file we will have indicated a type 1 record, without the output file name. If nothing is specified (see the contents of ZTBGFDAT), the file KI.FICHERO.ENTRADA.XML will be created.

```
********************************* Top of Data ****************************************
0-                                                 192.168.172.088-07774-300-   
1-                                            -                  -000000500000-N-    
2-                                            -                  -000000000000-S
******************************** Bottom of Data **************************************
```

Likewise, as an example of Function P (XML to flat), if we code in PARM

000099990000099940PEPITAPFKI.FICHERO.ENTRADA.XML

And in the ZTBGFDAT file we have indicated a type 2 record, with no output file name, the flat file KI.FICHERO.ENTRADA will be created

## Procedures. <a href="#toc160121863" id="toc160121863"></a>

### **Pre-issuance.**

The ZTBGP1X pre-issuance procedure is provided. Currently, the standard pre-issuance procedure (ZTBGP1C) has the following:

```cobol
//      PROC ORIGEN=,FUNCION=,L0=,          
//           L1=,L2=,R1=,R2=,AP=,LF=        
//A1P     EXEC PGM=ZTBGB110,                                      
//         PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&AP&LF/CBLQDA(ON)',   
//         REGION=0M,TIME=1440  
....       
//ZTBGFCAR DD DSN=KI.PMED.&L0..R&R1..R&R2..A&AP..ZTBGFCAR,DISP=SHR          
```

(ZTBGFCAR may not be used by the user, or may have been named differently)

The new procedure provided differs from the standard in that it has:

* A step before A1P (flat-to-XML converter)
* A SET for the LF variable
* New variables
* A change regarding the ZTBGFCAR list (if the user was already using it)

The ZTBGP1X pre-issuance is provided:

```cobol
//      PROC ORIGEN=,FUNCION=,L0=,                                    
//           L1=,L2=,R1=,R2=,AP=,LF=,FU=,TI=,FI=                      
//      SET LF=S                                                       
//      SET FU=X                                                      
//      SET TI=P                                                      
//*     SET FI=XX.XXXX.XXX                                            
//*********************************************************************
//*   EDITRAN/G PRE-ISSUANCE PROCEDURE                     *
//*   INCLUDES A PRE-LOAD STEP, WHICH CONSISTS OF THE SEPA STANDARD   *
//*   STEP FOR APPLICATION FILES FROM FLAT TO XML                     *
//*********************************************************************
//*   DATA:                                                           *
//*   ORIGIN (O=OPERATOR,E=EDITRAN,A=APPLICATION JCL) ----> 1 BYTE     *
//*   FUNCTION (01=LOAD OF PRESENTATION ISSUANCE,                   *
//*            03=PRESENTATION ISSUANCE,                            *
//*            04=DYNAMIC PRESENTATION ISSUANCE) -----> 2 BYTES    *
//*   PRESENTATION SESSION  ------------------------------>24 BYTES    *
//*   FILE LIST (S)   ------------------------------> 1 BYTE     *
//*     Regardless of whether the user indicates that they use a      *
//*     file list in the load, step01 passes to step A1P  *
//*     a new list of files to load (the XML files), so    *
//*     the value of this variable must always be set to S.        *
//*     The user, if using a file list, specifies it in &FI  *
//*   FUNCTION (X) (CONVERT FLAT TO XML IN STEP01) -----> 1 BYTE     *
//*   APPLICATION FILE TYPE (P/L/F) -------------------> 1 BYTE     *
//*     Indicates where to pull the XMLs from:                     *
//*     If P (PROFILE): step01 pulls from Editran/G profiles         *
//*     If F (FILE): the XML is specified in variable &FI       *
//*     If L (LIST): the list of XMLs is specified in variable &FI *
//*   APPLICATION FILE: DSNAME of the application file (the XML file)  *
//*   OR DSNAME of the list containing the application files -> 0-44 bytes *
//*     If &TI=P, &FI is not used, so you can put spaces        *
//*     If &TI=F, &FI=DSNAME.FILE.APLIC.XML                           *
//*     If &TI=L, &FI=DSNAME.LISTA.FILES.APLIC.XML                    *
//*********************************************************************
//INBORR1  EXEC PGM=IEFBR14                                           
//LPASO00  DD DSN=KI.PMED.R&R1..R&R2..A&AP..LISTFICX,                 
//         DISP=(OLD,DELETE,DELETE)                                    
//PASO01 EXEC PGM=ZTBXBXML,                                           
//      PARM='&L1&L2&R1&R2&AP&FU&TI&FI/CBLQDA(ON)'                    
//STEPLIB  DD   DSN=KI.EIDC.ZTBG.LOAD,DISP=SHR                        
//SYSTCPD  DD   DSN=SW.TCPIP.SEZAPARM(TCPDATAB),DISP=SHR              
//ZTBGFPRI DD   SYSOUT=*,DCB=(BLKSIZE=105)                            
//ZTBGFPER DD   DSN=KI.EIDC.ZTBG.ZTBGFPER,DISP=SHR                    
//ZTBGFLOG DD   DSN=KI.EIDC.ZTBG.ZTBGFLOG,DISP=SHR                    
//ZTBGFDAT DD   DSN=KI.EIDC.ZTBG.ZTBGFDAT,DISP=SHR                    
//ZTBGFCAR DD  DSN=KI.PMED.R&R1..R&R2..A&AP..LISTFICX,                
//            DISP=(NEW,CATLG,DELETE),                                
//            SPACE=(TRK,(500,50),RLSE),                              
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)              
//ZTXGFSAL DD  DSN=KI.PMED.R&R1..R&R2..A&AP..ZTBXFSAL,                
//            DISP=(NEW,CATLG,DELETE),                                 
//            SPACE=(TRK,(500,50),RLSE),                              
//            DCB=(RECFM=FB,LRECL=252,BLKSIZE=0,DSORG=PS)              
//SYSOUT   DD   SYSOUT=*                                              
//SYSPRINT DD   SYSOUT=*                                       
//SYSDBOUT DD   SYSOUT=*                                       
//ABENDAID DD   SYSOUT=*                                       
//SYSCOUNT DD   DUMMY                                          
//SYSUDUMP DD   SYSOUT=*                                       
//SYSABOUT DD   SYSOUT=*                                       
/*                                                             
//A1P     EXEC PGM=ZTBGB110,,COND=(0,NE,PASO01),               
//         PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&AP&LF/CBLQDA(ON)',
//         REGION=0M,TIME=1440                                 
....
//ZTBGFCAR DD   DSN=KI.PMED.R&R1..R&R2..A&AP..LISTFICX,DISP=SHR
```

* The LF=S variable has been set (the a1p step takes a file list created in PASO01, with the name KI.PMED.R\&R1..R\&R2..A\&AP..LISTFICX)
* The FU=X variable has been set (convert FLATS to XML)
* The TI=P variable has been set (the user wants the DSNAMEs of flat application files to be taken from the session profile). Note: if, for example, the user had created a list of application files to load, for example KI.PMED.R\&R1..R\&R2..A\&AP..ZTBGFLFE, we should set the variable SET FI=KI.PMED.R\&R1..R\&R2..A\&AP..ZTBGFLFE. The contents of this file were described in table-1.
* The ZTBGFDAT file, created by the user, must exist. Example:

```
***************************** Top of Data ********************************************
0-                                                 192.172.038.244-00994-300- -
1-%O.XML                                      -                  -            - -00000
2-                                            -                  -            -S
***************************** Bottom of Data *****************************************
```

* The application, in a first XML step, will convert the files indicated in the Editran/G PROFILE (TI=P) to XML format. It will create a new list, KI KI.PMED.R\&R1..R\&R2..A\&AP..LISTFICX, whose contents are a list of files with the names of the generated XML files (which will be DSNAME-FILE-APPLICATION.XML, because %O.XML was specified in ZTBGFDAT). Next, step A1P will use the new file list KI.PMED.R\&R1..R\&R2..A\&AP..LISTFICX (because LF=S was set), and will load them
* For example, if we have used a file list (TI=L), called KI.EGDC.L00.R123.R456789.APEPITA.ZTBGFCAR and it contains:

<pre><code>********************************* Top of Data ****************
REAF-KI.EIDA.FF01                                       
<strong>REAF-KI.EIDA.FF02                                    
</strong>******************************** Bottom of Data **************
</code></pre>

The contents of the file KI.PMED.R\&R1..R\&R2..A\&AP..LISTFICX will be:

```
********************************* Top of Data ****************
BNNF-KI.EIDA.FF01.XML                     
BNNF-KI.EIDA.FF02.XML                  
******************************** Bottom of Data **************
```

### **Post-reception.**

The ZTBGP4X post-reception is provided. Currently, the standard post-reception procedure (ZTBGP4C) has the following:

```cobol
//      PROC ORIGEN=,FUNCION=,L0=,          
//           L1=,L2=,R1=,R2=,AP=
//A4P     EXEC PGM=ZTBGB140,                                      
//         PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&AP/CBLQDA(ON)',   
---        
//ZTBGLFE EXEC PGM=ZTBGBLFE,COND=(0,NE,A4P),           
//        PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&AP',        
//ZTBGFLFE DD DSN=KI.PMED.&L0..R&R1..R&R2..A&AP..ZTBGFLFE,DISP=SHR
```

The new procedure provided differs from the standard in that it has:

```cobol
//      PROC ORIGEN=,FUNCION=,L0=,                                     
//           L1=,L2=,R1=,R2=,AP=,FU=,TI=,FI=                           
//      SET FU=P                                                       
//      SET TI=L                                                       
//      SET FI=KI.PMED.R&R1..R&R2..A&AP..ZTBGFLFE                      
//*********************************************************************
//*   EDITRAN/G POST-RECEPTION PROCEDURE                *
//*   NOTE: IF STEP ZTBGB140 ENDS WITH RC=01 IT IS BECAUSE IT IS NOT THE LAST*
//*         TRANSMISSION SESSION. IGNORE THAT WARNING              *
//*   INCLUDES A POST-DOWNLOAD STEP, WHICH CONSISTS OF THE SEPA STANDARD *
//*   STEP FOR DOWNLOADED XML FILES TO FLAT FILES                       *
//*********************************************************************
//*   DATA:                                                           *
//*      ORIGIN (O=OPERATOR,E=EDITRAN,A=APPLICATION JCL) ----> 1 BYTE  *
//*      FUNCTION (07=DOWNLOAD OF PRESENTATION RECEIPT,           *
//*               09=END OF PRESENTATION RECEIPT) -----> 2 BYTES *
//*      PRESENTATION SESSION  ------------------------------>24 BYTES *
//*   FUNCTION (P) (CONVERT XML TO FLAT IN STEP02) -----> 1 BYTE     *
//*   APPLICATION FILE TYPE (L) (LIST) ---------------> 1 BYTE     *
//*     The LFE step outputs a list, ZTBGFLFE, with the downloaded XML files  *
//*     step02 uses that &FI list to convert the XML files to flat files   *
//*   APPLICATION FILE: &FI, set to the name of the list    *
//*     output by the ZTBGLFE step                                      *
//*********************************************************************
//A4P      EXEC PGM=ZTBGB140,                                          
//         PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&AP/CBLQDA(ON)',           
//         REGION=0M,TIME=1440                                         
-----
//*********************************************************************
//*STEP TO GENERATE A LIST OF FILES RECEIVED IN THE PRESENTATION     
//*********************************************************************
//INBORR1  EXEC PGM=IEFBR14                                            
//LPASO00  DD DSN=KI.PMED.R&R1..R&R2..A&AP..ZTBGFLFE,                  
//         DISP=(OLD,DELETE,DELETE)                                    
//*                                                                    
//ZTBGLFE EXEC PGM=ZTBGBLFE,COND=(0,NE,A4P),                           
//        PARM='&ORIGEN&FUNCION&L1&L2&R1&R2&AP',                       
//        REGION=0M,TIME=25    
//ZTBGFLFE DD  DSN=KI.PMED.R&R1..R&R2..A&AP..ZTBGFLFE,    
//            DISP=(NEW,CATLG,DELETE),                    
//            SPACE=(TRK,(500,50),RLSE),                  
//            DCB=(RECFM=FB,LRECL=130,BLKSIZE=0,DSORG=PS) 
---
//*********************************************************************
//*STEP TO CONVERT THE XML FILES TO FLAT FILES                               
//*********************************************************************
//PASO02 EXEC PGM=ZTBXBXML,,COND=(0,NE,ZTBGLFE),                      
//      PARM='&L1&L2&R1&R2&AP&FU&TI&FI/CBLQDA(ON)'                    
//STEPLIB  DD   DSN=KI.EIDC.ZTBG.LOAD,DISP=SHR                        
//SYSTCPD  DD   DSN=SW.TCPIP.SEZAPARM(TCPDATAB),DISP=SHR              
//ZTBGFPRI DD   SYSOUT=*,DCB=(BLKSIZE=105)                            
//ZTBGFPER DD   DSN=KI.EIDC.ZTBG.ZTBGFPER,DISP=SHR
//ZTBGFLOG DD   DSN=KI.EIDC.ZTBG.ZTBGFLOG,DISP=SHR                  
//ZTBGFDAT DD   DSN=KI.EIDC.ZTBG.ZTBGFDAT,DISP=SHR                    
//ZTBGFCAR DD  DSN=KI.PMED.R&R1..R&R2..A&AP..ZTBGFLF2,                
//            DISP=(NEW,CATLG,DELETE),                                
//            SPACE=(TRK,(500,50),RLSE),                               
//            DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS)              
//ZTXGFSAL DD  DSN=KI.PMED.R&R1..R&R2..A&AP..ZTBXFSAL,                
//            DISP=(NEW,CATLG,DELETE),                                
//            SPACE=(TRK,(500,50),RLSE),                              
//            DCB=(RECFM=FB,LRECL=252,BLKSIZE=0,DSORG=PS)              
//SYSOUT   DD   SYSOUT=*                                              
//SYSPRINT DD   SYSOUT=*                                              
//SYSDBOUT DD   SYSOUT=*                                              
//ABENDAID DD   SYSOUT=*                                              
//SYSCOUNT DD   DUMMY               
//SYSUDUMP DD   SYSOUT=*            
//SYSABOUT DD   SYSOUT=*            
/*                                                                          
```

* An intermediate step between A4P-ZTBGLFE (which deletes the input file list that step ZTBGLFE is going to output
* An intermediate step after A4P-ZTBGLFE (XML-to-flat converter). Step A4P downloads the XMLs. Step ZTBGLFE outputs a list whose contents are the DSNAMEs of the downloaded files (see table-2). PASO02 uses that list (because TI=L and FI=KI.PMED.R\&R1..R\&R2..A\&AP..ZTBGFLFE ZTBGLFE were set) and converts to flat (because FU=P was set). This PASO02 also outputs a list KI.PMED.R\&R1..R\&R2..A\&AP..ZTBGFLF2 whose contents are the DSNAMEs of the final flat files to be handled by the application.
* The ZTBGFDAT file, created by the user, must exist. Example:

```
***************************** Top of Data ********************************************
0-                                                 198.172.033.233-00994-300- -
1-%O.XML                                      -                  -            -N-00000
2-                                            -                  -            -
***************************** Bottom of Data *****************************************
```

* For example, if the contents of KI.PMED.R\&R1..R\&R2..A\&AP..ZTBGFLFE were:

```
********************************* Top of Data ****************
KI.EIDA.FF01.XML                             20130517125457FIXED PAYMENT E1
KI.EIDA.FF02.XML                             20130517125458FIXED PAYMENT E2
******************************** Bottom of Data **************
```

The contents of the file KI.PMED.R\&R1..R\&R2..A\&AP..ZTBGFLF2 will be:

```
********************************* Top of Data ****************
BNNF-KI.EIDA.FF01                        
BNNF-KI.EIDA.FF02          
******************************** Bottom of Data **************
```


---

# 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/editran-sepa/jcls.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.
