× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: RPG to XML - XML - RPG +/-
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Sun, 13 Aug 2000 23:44:25 -0500 (CDT)


The asdbget utility for linux (and other unixes) will download an AS/400 
file and convert it to XML if this is your main goal... 

You can find it here:
http://cvs.cleveland.lug.net/module.pl?module=tn5250

If you want to write your own XML creator/parser in RPG IV, its certainly
possible (creating XML should actually be quite simple... parsing it would
be a bit more difficult, but not unduly so...)

To create a XML document, I'd just open a stream file in the IFS and write
the <BLAH> </BLAH> stuff in, in between the actual field data read from
the AS/400 file.

To parse, you'd probably want to use some kind of finite state machine.
Probably make a library of utilities for doing this, then throw them into
a service program.  

Of course, if you wanted your program to be able to handle this for an
arbitrary file, and parse an arbitrary XML format, it'd be a lot more work
But, again, possible...   

I'd try to give more help, but I don't really know enough about the
project's requirements.  (exactly how the XML should be formatted, whether
this needs to be possible for an arbitrary file, or if you can hard code
some details, like the filename, field names, positions, etc into the
data, what the data coming back looks like, etc)


On Sun, 13 Aug 2000 jpcarr@TREDEGAR.COM wrote:
> 
> Got a question asked of me and I thought I would pass it to the group for
> more input.
> 
>  I have a question concerning
> generating an XML document from an RPG program.  I am trying to accomplish
> a task of generating XML data from an AS/400 UDB database file to send  to
> insurance carriers and receive back XML data and populate the AS/400 UDB
> database file with the results.  Here are some additional facts concerning
> this issue:  We are going to be requesting real time insurance quotes from
> our insurance carrier partners.  One of our insurance carriers has a
> framework in place that accepts and sends quote requests via XML.  My
> question is how can we take an AS/400 file that has been created by a RPG
> ILE program and send it to the insurance carrier via HTTP in XML format??
> The insurance carrier said we can send the data as one large text field and
> they would take care of parsing it out on their end.  Also, how would we
> receive the XML data back into the AS/400 and put it back into the AS/400
> file??  I know there are some programs out on the IBM Alphaworks site to
> deal with this, but very unclear.  The ideal solution would be to
> accomplish this directly from our RPG ILE program that creates the file
> that is in the format that the insurance carriers need.
> 
> 
> John Carr
> 
> 
> +---
> | This is the RPG/400 Mailing List!
> | To submit a new message, send your mail to RPG400-L@midrange.com.
> | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator: david@midrange.com
> +---
> 
> 

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.