This statement has the following parameters:
Parameter | Description |
---|---|
DataItem | The name of the COBOL data item that contains data to be exported. |
DocumentName | The name of a file that will receive the exported XML document. |
ModelFileName#DataFileName | This parameter may be either of the following:
|
[StyleSheetName] | Optional. The name of an external XSLT stylesheet that will be used to transform the generated XML document before it is stored. |
The XML EXPORT FILE statement exports the content of the COBOL data item indicated by the DataItem parameter. The content of the data item is converted to an XML document using one or more files indicated by the ModelFileName#DataFileName parameter. The output of this conversion is to the file specified by the DocumentName parameter. If the optional StyleSheetName parameter is present, the external XSLT stylesheet is used to transform the document after it has been generated but before it is stored in the data file.
A status value is returned in the XML-data-group data item, which is defined in the copybook, lixmldef.cpy.
Without an External XSLT Stylesheet:
XML EXPORT FILE MY-DATA-ITEM "MY-DOCUMENT" "MY-MODEL-FILE". IF NOT XML-OK GO TO Z.
With an External XSLT Stylesheet:
XML EXPORT FILE MY-DATA-ITEM "MY-DOCUMENT.XML" "MY-MODEL-FILE" "MY-STYLE-SHEET" IF NOT XML-OK GO TO Z.
With an External XSLT Stylesheet and Parameters:
XML SET XSL-PARAMETERS "MY-COUNT", 7. IF NOT XML-OK GO TO Z. XML EXPORT FILE MY-DATA-ITEM "MY-DOCUMENT.XML" "MY-MODEL-FILE" "MY-STYLE-SHEET" IF NOT XML-OK GO TO Z