Generating XML Output from an SQR Program

An SQR program that generates XML output contains XML tags. XML tags describes the data. Use the XML commands to generate XML output.

To create XML output files, select XML as the format type when you schedule processes or jobs. For more information about scheduling process and jobs, seeUnderstanding Jobs and JobSets and Scheduling Process Requests.

To generate XML output from an SQR program, you must:

  1. Define the structure or template of the XML to be generated. Use the DEFINE-XML-TEMPLATE command to define the template.

    You can also create nested XML by adding one template to another. The definition of the child template should precede that of the parent.

  2. Create an XML-RECORD to define the XML template. To create an XML-RECORD, you must specify the data. Each template will have an XML-RECORD to add data. This data is created in the memory before being written on the disk.

    If you nest XML templates, you must add child XML-RECORDs before you add to the parent XML-RECORD. Multiple children can be added to a parent by repeated addition of child XML-RECORDs.

    Note: Check that child XML-RECORDs are not duplicated.

  3. Write the XML records to the disk. Use WRITE_TO_XML_FILE to write the XML records to the XML output file.

    Note: The parent template is cleared automatically after the XML records are written. You must clear the child templates manually.

Note: XML output format is not applicable to any of the existing reports that are shipped. Only new SQRs or the ones modified with the new commands will generate an XML file.