IBM Systems Magazine, Mainframe Edition - May/June 2010 - 53

Code Sample 3
the EMP data structure is correct and
-----+++++***** Generated XML DOC *****+++++----  123456  Troy Coleman  D01 4459 03/30/2001 MANAGER 16 M 01/13/1963 78250.00 500.00 .00 

the contents of the values stored in each elementary item are correct. The XML parser will return the formatted XML document in the xml-doc host variable, as seen in Code Sample 2, page 52. Code Sample 3 (left) shows XML stored in xml-doc host variable. Notice the tag names are the same as the host variable names as defined in the EMP structure. Also, the group element  is wrapped around the child elements  and . The version information is added due to the “with XML-declaration” parameter on the XML GENERATE statement. These are just a few of the many options available to you with the COBOL XML GENERATE statement.

In the first article I introduced the concepts associated with XML. In this article I introduced the XML System Services for z/OS parser and how to use it to publish an XML document from an input source such as a file. Now you have a solid foundation for processing XML in COBOL using the native z/OS XML parser. In the series’ conclusion, I’ll review examples of handling XML data stored in DB2.

Troy Coleman is principal product manager for z/OS DB2 Tools at CA Inc. He has 25 years of experience in IT, specializing in database management.

SHARE
August 1-5, 2010 Hynes Convention Center Boston, Massachusetts

in Boston

SHARE in Boston is the one conference that is…
' ' ' ' '
500+ technical sessions 20+ hands-on labs 40+ products and services vendors Professional networking Access to a community of IT professionals, IBM developers and industry experts

Get the answers you need at SHARE. Visit boston.share.org/2010.

ibmsystemsmag.com/mainframe

MAY/JUNE 2010

53


http://boston.share.org/2010 http://boston.share.org/2010 http://www.ibmsystemsmag.com/mainframe

IBM Systems Magazine, Mainframe Edition - May/June 2010

Table of Contents for the Digital Edition of IBM Systems Magazine, Mainframe Edition - May/June 2010

IBM Systems Magazine, Mainframe Edition - May/June 2010
Editor's Desk: Planned to a 'T"
Dashboard: Beef Up Your Passwords
Data Display: Cost of Security Breaches
IT Today: IBM Partnership Offers Cost-Effective BI Solutions
Trends: IBM's Eagle Studies Provide a Clear View of True Technology Costs Both Internal and External Communications
Insider: Six Computing Strategies for a Recovering Economy
Case Study: The Office of the CIO with the State of Nebraska Improved Data-Handling Issues with Smarter and Faster Data-Storage Tools
Harnes the Information Expansion: Discover the Hidden Value in your Business Data with System z
Green with Envy: Syracuse University's New Data Center is One to Covet
Focus on Storage: Tivoli Storage-Management Solutions Reduce Costs and Improve Efficiency
Developer: A Guide to Processing XML Documents Stored in Files and DB2
Solutions
Advertisers' Index
Stop Run: IBM's Plant-A-Tree Initiative Grows in Italy
Reference Point
IBM Systems Magazine, Mainframe Edition - May/June 2010 - IBM Systems Magazine, Mainframe Edition - May/June 2010
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Cover2
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 1
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 2
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 3
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 4
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 5
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 6
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 7
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 8
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 9
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Editor's Desk: Planned to a 'T"
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 11
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Dashboard: Beef Up Your Passwords
IBM Systems Magazine, Mainframe Edition - May/June 2010 - B1
IBM Systems Magazine, Mainframe Edition - May/June 2010 - B2
IBM Systems Magazine, Mainframe Edition - May/June 2010 - B3
IBM Systems Magazine, Mainframe Edition - May/June 2010 - B4
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 13
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Data Display: Cost of Security Breaches
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 15
IBM Systems Magazine, Mainframe Edition - May/June 2010 - IT Today: IBM Partnership Offers Cost-Effective BI Solutions
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 17
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 18
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 19
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 20
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 21
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Trends: IBM's Eagle Studies Provide a Clear View of True Technology Costs Both Internal and External Communications
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 23
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 24
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 25
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Insider: Six Computing Strategies for a Recovering Economy
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 27
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 28
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 29
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Case Study: The Office of the CIO with the State of Nebraska Improved Data-Handling Issues with Smarter and Faster Data-Storage Tools
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 31
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 32
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 33
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 34
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 35
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Harnes the Information Expansion: Discover the Hidden Value in your Business Data with System z
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 37
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 38
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 39
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 40
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 41
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Green with Envy: Syracuse University's New Data Center is One to Covet
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 43
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 44
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 45
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Focus on Storage: Tivoli Storage-Management Solutions Reduce Costs and Improve Efficiency
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 47
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 48
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 49
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Developer: A Guide to Processing XML Documents Stored in Files and DB2
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 51
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 52
IBM Systems Magazine, Mainframe Edition - May/June 2010 - 53
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Solutions
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Advertisers' Index
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Stop Run: IBM's Plant-A-Tree Initiative Grows in Italy
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Cover3
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Cover4
IBM Systems Magazine, Mainframe Edition - May/June 2010 - Reference Point
IBM Systems Magazine, Mainframe Edition - May/June 2010 - RF2
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I1
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I2
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I3
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I4
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I5
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I6
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I7
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I8
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I9
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I10
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I11
IBM Systems Magazine, Mainframe Edition - May/June 2010 - I12
http://www.ibmsystemsmagmainframedigital.com/mspcomm/ibmsystemsmag/ibmsystems_mainframe_20201112
http://www.ibmsystemsmagmainframedigital.com/mspcomm/ibmsystemsmag/ibmsystems_mainframe_20200910
http://www.ibmsystemsmagmainframedigital.com/mspcomm/ibmsystemsmag/ibmsystems_mainframe_20200708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20200506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20200304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20200102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/2020mfse
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20191112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20190910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20190708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20190506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20190304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/relevantz_20190102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/2019mfse
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20190102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20181112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20180910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20180708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20180506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20180304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20180102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/2018mfse
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20171112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170910_v2
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_sesupp
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20170102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_linuxsupp
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20161112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/MainframeSecurity
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20160910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20160708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20160506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20160304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20160102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20151112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150910_se
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150910
http://www.ibmsystemsmagmainframedigital.com/MFSkills
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150506_supp
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20150102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20141112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140910_v2
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_gt_201405
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/BigData
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20140102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20131112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130910_v2
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20130102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20121112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/buyersguide2013
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20120910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20120708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20120506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20120304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20120102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/ibmsystems_mainframe_2012bg
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20111112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20110910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20110708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20110506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20110304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20110102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20101112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100910_bg
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100506
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100304
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20100102
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20091112
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20090910
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20090708
http://www.ibmsystemsmagmainframedigital.com/nxtbooks/ibmsystemsmag/mainframe_20090506
https://www.nxtbook.com/nxtbooks/ibmsystemsmag/mainframe_20090304
https://www.nxtbookmedia.com