IBM Systems Magazine, Mainframe digital edition - September/October 2009 - (Page 46) Developer Mainframe application development Process XML Documents Within COBOL and DB2 BY TROY L. COLEMAN Editor’s Note: This is the first in a continuing series on XML, DB2 and COBOL development on z/OS. remember first hearing about XML and using XML with DB2* for Linux*, UNIX* and Windows* (LUW) in early 2001. XML use has grown exponentially since then, and DB2 technology now provides the capability to parse and store XML in its native form. Some people view XML as the universal format for sharing data among applications. Any application, running on any platform, using any database or file system can process data, as long as that application understands how to process XML. IBM understands applications won’t move to XML if they don’t perform well. That’s why IBM has been working vigorously to bring robust and efficient XML support to the z/OS* platform and delivered native XML data type with DB2 9 for z/OS. Many of the world’s businesses run on z/OS—with applications written in COBOL and processing data in Virtual Storage Access Method (VSA M), DB2 and Information Management System (IMS*). IBM realizes companies want to easily share data from these legacy systems with Internet-based systems running on many platforms. Service orientated architecture (SOA) and XML form the core to a robust and flexible solution. Long-time z/OS developers are busy supporting legacy applications written in COBOL and processing data stored in VSAM files, DB2 or IMS. These developers must learn XML and how to process XML documents. I’ll provide a brief explanation of XML, how to process XML documents stored in files within a COBOL program and how to process XML documents stored in DB2. I Before designing systems and writing applications that use XML, it’d be helpful to have some basic understanding of what a well-formed and valid XML document is. Since this article is on the use of COBOL and XML, I’ll compare the difference in processing an XML document to that of processing a file. With a file, you know the structure of each field and repeating field groups through a copybook. Having a copybook is necessary to understand the structure. The XML document is self-describing; you know each element and repeating element groups based on tags embedded within the document. Each element has a begin-tag and end-tag. The data’s structure or order is inherent through the hierarchical order of tags. XML parsers can only process a document that’s well formed. The XML document is considered well formed when each element has a start-tag “ ” and a corresponding end-tag “ ”. Code Sample 1 (below) is an example of a well-formed XML document containing an employee list. Code Sample 1 Troy Coleman IT01 01/24/2004 555-2325078 Maria Gonzalez Introduction to XML XML, a mature language, is in it’s fourth version. XML isn’t new; a standards committee guides requirements and ensures a single vendor doesn’t dominate it. 46 SEPTEMBER/OCTOBER 2009 HR01 05/17/1978 ibmsystemsmag.com/mainframe http://www.ibmsystemsmag.com/mainframe Table of Contents for the Digital Edition of IBM Systems Magazine, Mainframe digital edition - August/September 2009 IBM Systems Magazine, Mainframe digital edition - August/September 2009 Editor's Desk: IBM Makes it Easy to be Green Focus on Storage: System z, DS8000 and Tivoli Provide a Complete Encryption Package Trends: CICS Transaction Server 4.1 Helps Organizations, Compete, Comply and Control Case Study: Transzap Consolidates its Oracle Databases in a Virtualized Linux on Mainframe Environment Cover Story: IBM Poughkeepsie Green Data Center Showcases a Dynamic Infrastructure Feature: IBM Study Reveals the System z10 Provides a Cheaper, Easier-to-Manage Cloud Solution Feature: Women in IT Team Up to Succeed Developer: Process XML Documents Within COBOL and DB2 SSDs Are Integral to Enterprise Storage Infrastructures Product News Advertiser Index Stop Run: Gordon Bruce Talks His Way Into a High-Profile IT Gig Reference Point 2010 Mainframe Buyer's Guide IBM Systems Magazine, Mainframe digital edition - August/September 2009 IBM Systems Magazine, Mainframe digital edition - August/September 2009 - (Page Intro) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - IBM Systems Magazine, Mainframe digital edition - August/September 2009 (Page Cover1) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - IBM Systems Magazine, Mainframe digital edition - August/September 2009 (Page Cover2) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - IBM Systems Magazine, Mainframe digital edition - August/September 2009 (Page 1) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - IBM Systems Magazine, Mainframe digital edition - August/September 2009 (Page 2) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - IBM Systems Magazine, Mainframe digital edition - August/September 2009 (Page 3) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - IBM Systems Magazine, Mainframe digital edition - August/September 2009 (Page 4) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - IBM Systems Magazine, Mainframe digital edition - August/September 2009 (Page 5) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - IBM Systems Magazine, Mainframe digital edition - August/September 2009 (Page 6) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - IBM Systems Magazine, Mainframe digital edition - August/September 2009 (Page 7) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Editor's Desk: IBM Makes it Easy to be Green (Page 8) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Editor's Desk: IBM Makes it Easy to be Green (Page 9) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Focus on Storage: System z, DS8000 and Tivoli Provide a Complete Encryption Package (Page 10) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Focus on Storage: System z, DS8000 and Tivoli Provide a Complete Encryption Package (Page 11) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Focus on Storage: System z, DS8000 and Tivoli Provide a Complete Encryption Package (Page 12) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Focus on Storage: System z, DS8000 and Tivoli Provide a Complete Encryption Package (Page 13) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Focus on Storage: System z, DS8000 and Tivoli Provide a Complete Encryption Package (Page 14) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Focus on Storage: System z, DS8000 and Tivoli Provide a Complete Encryption Package (Page 15) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Trends: CICS Transaction Server 4.1 Helps Organizations, Compete, Comply and Control (Page 16) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Trends: CICS Transaction Server 4.1 Helps Organizations, Compete, Comply and Control (Page 17) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Trends: CICS Transaction Server 4.1 Helps Organizations, Compete, Comply and Control (Page 18) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Trends: CICS Transaction Server 4.1 Helps Organizations, Compete, Comply and Control (Page 19) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Trends: CICS Transaction Server 4.1 Helps Organizations, Compete, Comply and Control (Page 20) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Trends: CICS Transaction Server 4.1 Helps Organizations, Compete, Comply and Control (Page 21) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Case Study: Transzap Consolidates its Oracle Databases in a Virtualized Linux on Mainframe Environment (Page 22) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Case Study: Transzap Consolidates its Oracle Databases in a Virtualized Linux on Mainframe Environment (Page 23) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Case Study: Transzap Consolidates its Oracle Databases in a Virtualized Linux on Mainframe Environment (Page 24) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Case Study: Transzap Consolidates its Oracle Databases in a Virtualized Linux on Mainframe Environment (Page 25) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Case Study: Transzap Consolidates its Oracle Databases in a Virtualized Linux on Mainframe Environment (Page 26) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Case Study: Transzap Consolidates its Oracle Databases in a Virtualized Linux on Mainframe Environment (Page 27) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Cover Story: IBM Poughkeepsie Green Data Center Showcases a Dynamic Infrastructure (Page 28) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Cover Story: IBM Poughkeepsie Green Data Center Showcases a Dynamic Infrastructure (Page 29) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Cover Story: IBM Poughkeepsie Green Data Center Showcases a Dynamic Infrastructure (Page 30) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Cover Story: IBM Poughkeepsie Green Data Center Showcases a Dynamic Infrastructure (Page 31) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Cover Story: IBM Poughkeepsie Green Data Center Showcases a Dynamic Infrastructure (Page 32) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Cover Story: IBM Poughkeepsie Green Data Center Showcases a Dynamic Infrastructure (Page 33) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Cover Story: IBM Poughkeepsie Green Data Center Showcases a Dynamic Infrastructure (Page 34) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Cover Story: IBM Poughkeepsie Green Data Center Showcases a Dynamic Infrastructure (Page 35) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Feature: IBM Study Reveals the System z10 Provides a Cheaper, Easier-to-Manage Cloud Solution (Page 36) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Feature: IBM Study Reveals the System z10 Provides a Cheaper, Easier-to-Manage Cloud Solution (Page 37) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Feature: IBM Study Reveals the System z10 Provides a Cheaper, Easier-to-Manage Cloud Solution (Page 38) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Feature: IBM Study Reveals the System z10 Provides a Cheaper, Easier-to-Manage Cloud Solution (Page 39) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Feature: IBM Study Reveals the System z10 Provides a Cheaper, Easier-to-Manage Cloud Solution (Page 40) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Feature: IBM Study Reveals the System z10 Provides a Cheaper, Easier-to-Manage Cloud Solution (Page 41) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Feature: Women in IT Team Up to Succeed (Page 42) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Feature: Women in IT Team Up to Succeed (Page 43) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Feature: Women in IT Team Up to Succeed (Page 44) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Feature: Women in IT Team Up to Succeed (Page 45) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Developer: Process XML Documents Within COBOL and DB2 (Page 46) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Developer: Process XML Documents Within COBOL and DB2 (Page 47) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Developer: Process XML Documents Within COBOL and DB2 (Page 48) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Developer: Process XML Documents Within COBOL and DB2 (Page 49) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - SSDs Are Integral to Enterprise Storage Infrastructures (Page 50) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - SSDs Are Integral to Enterprise Storage Infrastructures (Page 51) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - SSDs Are Integral to Enterprise Storage Infrastructures (Page 52) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - SSDs Are Integral to Enterprise Storage Infrastructures (Page 53) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Product News (Page 54) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Advertiser Index (Page 55) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Stop Run: Gordon Bruce Talks His Way Into a High-Profile IT Gig (Page 56) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Stop Run: Gordon Bruce Talks His Way Into a High-Profile IT Gig (Page 57) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Stop Run: Gordon Bruce Talks His Way Into a High-Profile IT Gig (Page 58) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Stop Run: Gordon Bruce Talks His Way Into a High-Profile IT Gig (Page Cover3) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Stop Run: Gordon Bruce Talks His Way Into a High-Profile IT Gig (Page Cover4) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Reference Point (Page RF1) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - Reference Point (Page RF2) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BGCover1) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BGCover2) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG1) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG2) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG3) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG4) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG5) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG6) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG7) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG8) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG9) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG10) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG11) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG12) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG13) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG14) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG15) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG16) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG17) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG18) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG19) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG20) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG21) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG22) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG23) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG24) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG25) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG26) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG27) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG28) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG29) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG30) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG31) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG32) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG33) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG34) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG35) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG36) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG37) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG38) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG39) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BG40) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BGCover3) IBM Systems Magazine, Mainframe digital edition - August/September 2009 - 2010 Mainframe Buyer's Guide (Page BGCover4) http://www.nxtbookMEDIA.com
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.