Skip to content

COBOL Variable Names

The COBOL variable names used in the COBOL-to-XML copybooks are of two types: control variables and content variables.

Control Variables

Control variable names appear in all capitals. Most control variables are used by the COBOL batch client subroutine, SERXMLCC, to manipulate the data exchanged with user programs.

Some control variables map to the Serena XML Services subtags within the <header> and <response> data structures. The function of a control variable is consistent across all COBOL-to-XML copybooks.

The table below lists the COBOL control variables used in all COBOL-to-XML copybooks.

COBOL Variable Name XML Parent Tag XML Subtag Name Page #
REQUEST-BUFFER-LENGTH N/A N/A N/A
RESULT-COUNT N/A N/A N/A
HEADER-SUBSYS <header> <subsys>
HEADER-TEST <header> <test>
HEADER-SCOPE <service> <scope>
HEADER-MESSAGE <scope> <message>
HEADER-METHOD <header> <method>
RESULT-RC <response> <statusReturnCode>
RESULT-REASON <response> <statusReasonCode>
RESULT-MESSAGE <response> <statusMessage>

Note

If a blank specification (<method> </method>) is used, the code first tries to use <method>X and, if that fails, it tries to use <method>T. See Preferred Connection Method

Content Variables

Content variables in the COBOL copybooks map one-to-one against Serena XML Services subtags within the <request> and <result> data structures. Different sets of content variables appear in each COBOL-to-XML copybook.

COBOL content variable names correspond closely to the names of their matching Serena XML Services tags. Given an XML tag name, you can obtain its equivalent COBOL variable name by applying the following transformation rules:

  • Input variables (i.e., those corresponding to XML tags in the <request> data structure) are prefixed in COBOL with I-.

  • Output variables (i.e., those corresponding to XML tags in the <result> data structure) are prefixed with O-.

  • Underscores in XML tag names are replaced by hyphens in COBOL variable names.

  • Delimiting angle brackets are not part of the XML tag name and are omitted from the corresponding COBOL variable name.

  • Case is preserved. Upper-case characters in XML tag names are upper-case in COBOL variable names. Lower-case characters in XML tag names are lower-case in COBOL variable names.

  • XML tag names are truncated to 30 characters in COBOL variable names. When the I/O prefix is added, the XML tag names are truncated to 28 characters.

The table below shows example transformations from XML tag names to their COBOL variable names. This subset is selected from the "list general parameters" function of the package management service object. The relevant copybook name is XMLCPGPM.

XML Parent Tag XML Subtag Name COBOL Variable Name
<request> <package> I-package
<applName> I-applName
<isLinkedPackage> I-isLinkedPackage
<result> <package> O-package
<applName> O-applName
<packageLevel> O-packageLevel
<packageType> O-packageType
<packageStatus> O-packageStatus
<dateFrozen> O-dateFrozen
<dateApproved> O-dateApproved
<dateInstalled> O-dateInstalled
<isLinkedPackage> O-isLinkedPackage

Data Types, Values, and Constraints

Data type, value constraints, and interdependencies for a given XML tag (or group of tags) apply equally to any corresponding COBOL variable(s) in a COBOL-to-XML copybook. This information is detailed in the Serena XML Services Reference Tables, which contain a series of indexed HTML files that describe each service.

Tip

Serena XML Services data restrictions are defined broadly enough to accommodate both mainframe and distributed ChangeMan products. Where ChangeMan ZMF has a more restrictive internal data requirement than the XML interface allows (e.g., for data length), the more restrictive requirement should be followed.