Question

exporting db/2 to xml

Asked by: tkshatriya

We are trying to integrated iseries (v5r4) with peoplesoft sql database. I'm looking for some example from as/400 DB2/ to export data (post the data ) in xml format . I read the article about XML-INTO and an XML-SAX op-code. Thisop code deal with  xml data importing to db/2 .

Can anyone shed lights for exporting db/2 to xml ?

Any recommendation, books , article apperciated.

We are trying to integrated iseries (v5r4) with peoplesoft sql database. I'm looking for some example from as/400 DB2/ to export data (post the data ) in xml format . I read the article about XML-INTO and an XML-SAX op-code. Thisop code deal with  xml data importing to db/2 .
 
Can anyone shed lights for exporting db/2 to xml ? 
 
Any recommendation, books , article apperciated.

                                  
1:
2:
3:
4:
5:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-07-02 at 13:03:45ID24540773
Tags

exporting db/2 to xml

Topics

Programming for iSeries / AS400

,

AS / 400

,

IBM Websphere Application Server

Participating Experts
2
Points
75
Comments
7

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Java XML SAX
    hi experts, i have a question regarding SAX.. hope is the right place to ask. im quite new in xml processing, i am able to read and process xml through SAX, and store them into classes. now i would like to know how to revert this process? i have the xml schema, anyone kno...
  2. .net and AS/400 DB2
    I'm new to AS.400 environment and DB2/400. New projects are coming through at work which get me to start using .net technologies. Whats the best way to connect to the As/400 to achieve the following. 1)Database operations that meet this criteria. a. Best performance ...
  3. XML Toolkit for iSeries
    How do I know if I have an XML Toolkit on my AS/400. I want to create an XML document from an RPG / CL program.
  4. Connecting to an AS/400 iSeries database from C#
    I have an application where I need to connect to an AS/400 iSeries database. What is the best way to handle this?

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: Gary_The_IT_ProPosted on 2009-07-04 at 01:23:43ID: 24776317

Any particular reason you want to go through XML, when you could just connect directly to the Peoplesoft DBMS via ODBC, DRDA, JDBC, etc (depends on which dbms you are running Peoplesoft on)?  

Depending on your requirements, it might be simple to write one piece of code that connects to the Peoplesoft database, extracts data using SQL, and then updates the appropriate DB2 tables.

If you want to explore that option in more detail, let me know.

Now, let's focus on generating XML.

Sounds like you need to pull from iseries and push to Peoplesoft, so maybe you already have code on the Peoplesoft box to process incoming XML files.

There are lots of ways to get XML from DB2.  Far too many ways.

You can write code in RPG or Java to do the task.  IBM offers the XML Toolkit to help with XML application development.  The third link below explains how to use the XML4PR parser from the Toolkit in RPG:

http://www-03.ibm.com/systems/i/software/xml/index.html

http://publib.boulder.ibm.com/infocenter/iseries/v5r3/index.jsp?topic=/rzamj/rzamjmain.htm
http://www.ibmsystemsmag.com/ibmi/may03/developer/8909p1.aspx

There is an IBM product called DB2 XML Extender that you can order (or may already own - GO LICPGM, Option 10 to view installed licensed programs on your system).  Check with your IBM rep or business partner for pricing.

http://www-01.ibm.com/support/docview.wss?rs=72&uid=swg21293639
http://www.redbooks.ibm.com/abstracts/redp0135.html?Open

There is a great free AS/400 utility called SQL2XML that converts SQL results sets to XML.  mcpressonline.com annoyingly requires a lengthy registration to see the article, but it is worth it in the long run, and there is a lot of great content here anyway.  

http://www.mcpressonline.com/tips-techniques/sql/techtip-sql2csv-and-sql2xml.html

If you have Microsoft SQL Server 2005 or 2008 around (don't know about earlier versions), you can create a linked server for your AS/400, and use SQL server XML extensions:

http://dotnetslackers.com/articles/xml/Dynamic_XML_From_SQL_Server.aspx

You can do something similar with mySQL:

http://www.kitebird.com/articles/mysql-xml.html

Sometimes, a little SQL works wonders for simple XML transformations.  redirect output to a file in the STRSQL environment, compile and run as a query management query (CRTQMQRY, STRQMQRY), embed in and RPG program, or use as the SELECT clause if an INSERT INTO.

SELECT DISTINCT '<customer>' as XMLLINE from dummyfile          
  UNION                                                    
SELECT '<name>' || cusnam || '</name><address>' || cusadr || '</address>' as XMLLINE from custfile                          
  UNION                                                    
SELECT DISTINCT '</customer>' as XMLLINE from dummyfile        

Hope this gives you a place to start.

- Gary Patterson



 

by: tkshatriyaPosted on 2009-07-06 at 12:48:08ID: 24788590

Thank you gary for answering my query. The reason we using XML format because we wanted real time integration between db/2 and peoplesoft.  what is best way to approach this. ?

 

by: Gary_The_IT_ProPosted on 2009-07-06 at 13:02:55ID: 24788719

OK, I understand "real-time integration", but why, specifically, do you want XML?  Is there some technical reason that you need to format XML?  Do you have Peoplesoft utilities that can easily import XML (that would be a very good reason for XML)?  XML is a great technology, but it is by no means a "one size fits all" solution for data interchange.

There is no one global "perfect solution" for this kind of integration.  It depends on numerous factors:

  • What type of information, specifically, do you need to exchange between the two systems?  (Show us table layouts if you can). 
  • How many transactions in a day do you anticipate?  How big (in bytes) is each transaction (unformatted)? 
  • What OS platform is Peoplesoft running on, and what database management system? 
  • Do you need to transfer information from AS/400 to Peoplesoft, Peoplesoft to AS/400, or in both directions? 
  • Since you need "real time", what are the triggering events (and on which platforms)? 
  • What is the speed of the slowest network link between the two machines (some techniques use more bandwodth than others.  If the two machines are on the same switch in the same building, that may not be much of a consideration.  If they are in different data centers across a WAN link it may be a very significant design limitation. 
  • How reliable does the data exchange need to be?  What is the exposure to the business if a transaction fails? 
  • What about security and confidentiality?  Does the data need to be encrypted while it is "in flight" between the systems? 
  • Are there existing interfaces, utilities, and/or APIs to handle these data extracts and imports that can be leveraged?
     

- Gary Patterson

 

by: shalomcPosted on 2009-07-07 at 01:22:12ID: 24792303

"Real time" implies some sort of web services.
However, the biggest question is whether the applications are to be loosely coupled or tightly coupled.

On an architectural level, loosely coupled applications use a buffer between them, and asynchronous messaging. In simple words - application A does not have to wait for application B to reply.

Tightly coupled application have no buffer, and the messaging is synchronous. Application A waits for application B to reply.

You can have very fast and loosely coupled integration - for example using MQ or some kind of ESB.

Tightly coupled applications nowadays use web services, as a replacement to remote calls.

XML is a way to encode messages, and is also used to describe services (WSDL) and to wrap the application level messages in standard containers (SOAP).

Now, on top of Gary's questions, can you say which XML are you after? Do you need application level XML, SOAP, or web services?

Will the AS400 serve as a client, server, or both?

 

by: tkshatriyaPosted on 2009-07-07 at 06:50:28ID: 24794191

Appericiate Gary. Thank you for clarification. Here is my project goal.

Currently, we have RPG program on AS/400 which replace file(table) every night at 11.30 PM. SQL 2005(odbc) connection is setup to transfer data from AS/400 to Peoplesoft enviorment. We have temp table which gets replace on peoplesoft enviorment everyday midnight. Application engine job is schedule to trasnfer the data from peoplesoft temp. table to various table in peoplesoft database.

in Nutshell,

1) RPG program replace temp. table
2) make odbc connection through sql 2005 to peoplesoft database
3) transfer temp. table inormation to another peoplesoft temp.table
4)  application engine (peoplecode) job pickup data and update peoplesoft various table.

Since, citizen information get transfer every night. Peoplsoft (CRM call center) have to wait for the day to get update citizen information. So, we decided to have real time intergration between this two system to make call center user life easier.

I was looking best approach to handle this request for real time intergration.  



 

by: tkshatriyaPosted on 2009-07-07 at 07:33:17ID: 24794574

OK, I understand "real-time integration", but why, specifically, do you want XML?

Not necessarily, I was looking for best approach to handle the real time integration request.

Is there some technical reason that you need to format XML?  Do you have Peoplesoft utilities that can easily import XML (that would be a very good reason for XML)?  XML is a great technology, but it is by no means a "one size fits all" solution for data interchange.


No, I dont have any reason to opt the XML format. Like I mentioned I m looking real time integration between this two system and trying to find best approach. The reason I was doing research on XML format as PeopleSoft version PT 8.48 integration broker  sends or receives messages  containing data in a variety of formats. Formats include PeopleSoft rowset-based message format, and nonrowset-based message structures including , XML document object model messages, Simple Object Access Protocol (SOAP) messages, and non-XML files.


There is no one global "perfect solution" for this kind of integration.  It depends on numerous factors:
"      What type of information, specifically, do you need to exchange between the two systems?  (Show us table layouts if you can).  
This is table layout

CUST_ID_1      char      no      9                            no      no      no      
CUST_NM_TY      char      no      1                            no      no      no
CUST_AREA_CODE      char      no      3                            no      no      no
CUST_PHONE      char      no      7                            no      no      no      
CUST_NM      char      no      30                            no      no      no      
CUST_ADD1      char      no      30                            no      no      no      
CUST_ADD2      char      no      30                            no      no      no      
CUST_CITY      char      no      20                            no      no      no      
CUST_STATE      char      no      2                            no      no      no      
CUST_ZIP      char      no      9                            no      no      no      
CUST_ST_NO      char      no      7                            no      no      no      
CUST_DIR_CODE      char      no      2                            no      no      no      
CUST_QUAL_PRE      char      no      10                            no      no      no      
CUST_ST_NM      char      no      25                            no      no      no      
CUST_ST_SUFF      char      no      4                            no      no      no      
CUST_POST_ST_DIR      char      no      2                            no      no
CUST_ST_QUL_POST      char      no      5                            no      no      no      
CUST_ST_APT_NO      char      no      5                            no      no      no
CUST_LOC_CITY      char      no      20                            no      no      no      
CUST_ZIP_CODE      char      no      9                            no      no      no      
CUST_EMAIL      char      no      50                            no      no      no      
CUST_ACCNO      char      no      20                            no      no      no
CUST_ALT_PHONE      nchar      no      80                            yes      (n/a)      (n/a)
CUST_WRK_PHONE      nchar      no      80                            yes      (n/a)      (n/a)
CUST_EMAIL_ADD      nchar      no      80                            yes      (n/a)      (n/a)      
LAST_PHN_CHNG_DT      nchar      no      80                            yes      (n/a)      (n/a)

      
"      How many transactions in a day do you anticipate?  How big (in bytes) is each transaction (unformatted)?  

Approx. 1000 records back and forth transfer from AS/400 to PeopleSoft daily .  When Tarrant district makes mages changes then appx. 5000 to 6000 records expected every six months.



"      What OS platform is Peoplesoft running on, and what database management system?  

O/S 2003 , SQL 2005

"      Do you need to transfer information from AS/400 to Peoplesoft, Peoplesoft to AS/400, or in both directions?  

Yes
"      Since you need "real time", what are the triggering events (and on which platforms)?  
Real time integration when call center user make any changes in address, phone or information of citizen , we need trigger that go back and update PeopleSoft system and vice versa.



"      What is the speed of the slowest network link between the two machines (some techniques use more bandwodth than others.  If the two machines are on the same switch in the same building, that may not be much of a consideration.  If they are in different data centers across a WAN link it may be a very significant design limitation.  

Both the system/server is located in same building.

"      How reliable does the data exchange need to be?  What is the exposure to the business if a transaction fails?  


Since it involved citizen sensitive information we need this information to transfer at very secure level.

"      What about security and confidentiality?  Does the data need to be encrypted while it is "in flight" between the systems?  

Still trying to figure it out best approach and wants the data to be transfer securely.

"      Are there existing interfaces, utilities, and/or APIs to handle these data extracts and imports that can be leveraged?
Yes,  Peoplesoft do accept generic API from third party . Like I mentioned earlier still in research phase and trying my best to find the right approach for this integration.


Thank you


 

by: Gary_The_IT_ProPosted on 2009-07-08 at 08:58:26ID: 24805176

Well, for the AS/400 to Peoplesoft interface, it looks like you have a lot of options for your interface.  Without seeing the Integration Broker documentation, it is difficult to advise as to the best mechanism.

If you have a single program that updates the Citizen database on the AS/400, then you can just modify that program to kick out an Integration Agent message in whatever format you choose (XML, rowset, SOAP message, etc.).

If the database is updated from multiple programs, you might find it easier to create an update trigger program on the underlying table and have that trigger program handle the message creation.  When I design trigger programs, I often opt for an asynchronous model, where the trigger program just puts an entry on a data queue, and a seperate service job blocks on the data queue and handles any IO and communications part of the process.  This keeps your trigger program from slowing down database operations and the inderlying programs that update the Citizen database.

Process 1
TRIGGER PROGRAM calls QSNDDTAQ ...

Process 2 (Never-ending service job)
QRCVDTAQ -> Format and send message to Peoplesoft

- Gary Patterson

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...