Export and Import XML Tool

This document describes the Export and Import XML tool.

The Adabas System Coordinator XML tool provides facilities to:

  • Export configuration file settings

  • Import configuration file settings

  • Export configuration file historical information

  • Export live statistics

  • Verify XML documents according to CORXML syntax

CORXML runs in a standard batch Natural job.


CORXML in Batch Mode

In a batch Natural environment

  • Use CORXML as the program name;

  • Define Natural work file 1 (CMWKF01). The file must have fixed records of length 80 and the Natural parameters for work file 1 must specify OPEN=OBJ,CLOSE=CMD.

  • Execute the utility from the required SYSMPvrs library.

Example:

LOGON SYSMP821
CORXML
CHECK
STOP
FIN

Normal execution is indicated by condition code 0.

Errors are reported in CMPRINT and accompanied by execution termination code 4.

CORXML Control Input

The following functions are available specified through CMSYNIN control input:

EXPORT Export selected data to an XML document in Natural’s work file 1 (CMWKF01)
IMPORT Update configuration file objects according to the XML document in work file 1
CHECK Syntax check the XML document in work file 1

Each execution of CORXML performs a single function beginning with a CMSYNIN line stating "CORXML".

Control input for the function must be specified on a separate CMSYNIN line.

Each function requires a CMSYNIN line containing "STOP" to terminate it.

Optional comments are allowed and should be preceded by "/*".

You can execute CORXML more than once in a single CMSYNIN input file.

The following example shows multiple CORXML operations in one submission of control input (an XML syntax check followed by an import):

CORXML
CHECK
STOP
CORXML
IMPORT
REPLACE=YES TRANSACTION-RATE=1000
STOP
FIN

EXPORT

EXPORT writes output information as an XML document.

The CORXML control input for export has the format:

CODE OBJECT-TYPE SELECTION-CRITERIA  /* optional comment

Each control input must start on a separate CMSYNIN line. If required, control input can be split across several lines by entering a "+" at the end of the line (before the comment, if there is one). For example here is a Vista partitioned file control input continued on a second CMSYNIN line also with comments:

PARTITIONED-FILE  + /* Export Vista partitioned files
DATABASE=1:100      /* for databases 1 to 100  

Note:
You must not split control input in the middle of an object type or selection criterion.

Selection criteria are of the format KEYWORD=inclusive-from-value:inclusive-to-value and are interpreted as follows:

  • If no values are specified, all objects are selected for this criterion.

    Example, select all databases:

    DATABASE=
  • If both values are specified, objects in that inclusive range are selected.

    Example, select databases 1 through 100:

    DATABASE=1:100
  • If only an end value is specified, all objects up to and including the end value are selected.

    Example, select all databases up to and including 200:

    DATABASE=:200
  • If only a starting value (with the through colon) is specified, objects greater than or equal the starting value are selected.

    Example, select databases 100 through all the rest higher that are present:

    DATABASE=100:
  • If a single value is specified, with no colon, only objects that match that value are selected.

    Example, select database 25:

    DATABASE=25
  • If a value you wish to select actually contains the colon character, enclose the whole value in single quotation marks.

    Example, selects names ABC:DEF through ZZZZZZZZ:

    NAME=’ABC:DEF’:ZZZZZZZZ

Examples:

CORXML
EXPORT
AFP BUFFER-FILE NAME=ABC DATABASE=:100    /* All files for databases 1 to 100 in “ABC”
AVI PARTITIONED-FILE DATABASE= FILE=21:30  /* partitioned files 21 to 30 in all databases  
AVI TRANSLATION NAME=*ACTIVE +                   /* translations from the active generation
                PAGE=PROD0010:PROD0020 +                   /* for pages PROD0010 to PROD0020
                DATABASE=1                                             /* in database 1
COR CLIENT TYPE=CICS NAME=                            /* all CICS runtime controls
STOP

Some selection criteria are mandatory; others are optional (see the table below). If an optional criterion is omitted, all objects are selected for that criterion.

Code Object Keyword Description
ALL     Exports all configuration objects in the configuration file.
AFP BUFFER NAME Export Adabas Fastpath buffer parameters for the buffers selected according to the NAME criteria. NAME is mandatory.
AFP BUFFER-FILE

NAME
DATABASE
FILE

Export Adabas Fastpath file parameters for the selected buffers, databases and files. NAME is mandatory, DATABASE and FILE are optional.
AVI PARTITIONED-FILE

DATABASE
FILE

Export Adabas Vista partitioned file definitions for the selected databases and files. DATABASE is mandatory, FILE is optional.
AVI TRANSLATION

NAME
PAGE
MODE
DATABASE
FILE

Export Adabas Vista translation rules according to the specified criteria. NAME is mandatory and specifies the generations for which rules are to be exported or it may specify *ACTIVE to export rules from the current active generation. PAGE, MODE, DATABASE and FILE are optional and are used to select which pages, source databases and files are to be exported. MODE may only specify a single value. Omit MODE to export rules for all categories.
COR GROUP NAME Export System Coordinator group and daemon definitions for the selected groups. NAME is mandatory.
COR CLIENT

NAME
TYPE

Export runtime control base and override definitions for the selected runtime controls. NAME and TYPE are both mandatory. TYPE may only specify a single value. Specify TYPE= to select runtime controls of all types. These types are valid:

  • BATCH

  • COMPLETE

  • CICS

  • CICS-DTR

  • IMS

  • UTM

  • TSO

  • TIAM

  • MULTITCB

  • SINGLTCB

  • MISCDTR

  • SPATS

  • API-1

  • API-2

IMPORT

Import reads an XML document and updates the configuration file accordingly.

The following control inputs may be specified in CMSYNIN, if required:

Keyword Values Description
REPLACE

YES
NO

Whether or not to replace existing configuration file objects. The default is YES.
TRANSACTION-RATE 1 – 65535 Number of updates per transaction. The default is 1.

Example:

CORXML
IMPORT
REPLACE=NO,TRANSACTION-RATE=100
STOP

Check

Check reads an XML document and checks the syntax of the XML.

It has no control input.

Example:

CORXML
CHECK
STOP

Sample XML Document Output File

Here is an extract of an XML document produced by EXPORT, followed by an explanation of the contents.

Note:
The display here is taken from a mainframe editor session. It shows sequence numbers for each line in the editor. The sequence numbers are not part of the XML document.

0001 <?xml version="1.0"?>                                               
0002 <EXPORT-IMPORT>                                                     
0003   <PARTITIONED-FILE PRODUCT-CODE="AVI" FUNCTION="ADD" REPLACE="">
0004     <DATABASE>1</DATABASE>                                        
0005     <FILE>999</FILE>                                              
0006     <NAME>DB1</NAME>                                              
0007     <FIELD>AA</FIELD>                                             
0008     <FORMAT>A</FORMAT>                                            
0009     <LENGTH>8</LENGTH>    
...
0044     <PARTITION>                               
0045       <COLLATION-ORDER>1</COLLATION-ORDER>  
0046       <DATABASE>12</DATABASE>               
0047       <FILE>1</FILE>                        
0048       <NAME></NAME>                          
0049       <ACCESS>FULL</ACCESS>                 
0050       <TOP-ISN>16777215</TOP-ISN>           
0051       <CRITICAL>Y</CRITICAL>                
0052       <SHARED>N</SHARED>                    
0053       <HIGH-VALUE>                            
0054         <DATA>I</DATA>                      
0055       </HIGH-VALUE>                           
0056     </PARTITION>   
...
0808   </PARTITIONED-FILE>
0809 </EXPORT-IMPORT>    
Line Description
0001 XML options This is optional and only for documentation purposes. If specified, it must be at the start of the file.
0002 Root start This must be the first record in the file, other than XML options.
0003 Configuration file object This specifies the object type, owning product code, whether to add or delete this object and, for add, whether or not to replace this object if it already exists. FUNCTION defaults to ADD and REPLACE to null, which causes the import to use the REPLACE setting specified in the CMSYNIN input. Specify REPLACE=”YES” or REPLACE=”NO” to override the CMSYNIN setting.
0004 to 0009 Object data Data values for this object. Each data item is expressed as a start tag, a value and an end tag (the value may be missing if the item has no value). See the relevant product’s parameter documentation for a list of valid data items and values.
0044 Configuration file object component A “child” of the current configuration file object. For example, partitioned files consist of one or more partition definitions.
0045 to 0055 Object component data and subordinate component Data items for the component and any subordinate components.
0056 Component end tag Each component definition must be terminated correctly.
0808 Object end tag Each object definition must be terminated correctly.
0809 Root end This must be the last record in the file.