× 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.





Oh my!!! This will solve a couple problems for me. Thanks for the idea.



Sharon Wintermute

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael Ryan
Sent: Wednesday, November 19, 2008 2:23 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Composing XML and RPG

Argh! Why is this not in RPG? This is the easiest thing in the world!

On Wed, Nov 19, 2008 at 2:08 PM, Peter Connell
<Peter.Connell@xxxxxxxxxxxxxxxxx> wrote:
Sharon,
Given that IBM ships a COBOL compiler with the iSeries, this means
that
it is available for specific ILE modules other than RPGLE just as you
might incorporate a CLP or C program.
Since RPGLE does provide built-in operations for generating XML, it is
not difficult to roll your own.
While RPGLE is great, you may be surprised to know that COBOL has also
entered the new age.

As the code below reveals, COBOL is a step ahead (at least in this
respect) since the compiler now provides for operations that generate
XML.
This code simply dumps the data structure for EmployeeRec to a stream
file.
I found the temptation to investigate this difficult to resist.
To prove it just paste this into a source member in a QCBLLESRC file
and
run PDM option 14.
However, it would take a little more COBOL skill to determine if this
could effectively be integrated as a procedure to be called from
RPGLE.

PROCESS OPTIONS.
IDENTIFICATION DIVISION.
PROGRAM-ID. VERIFY.
AUTHOR. PROGRAMMER NAME.
INSTALLATION. VEDAADVANTAGE.
DATE-WRITTEN. SEPTEMBER 10, 2008.
DATE-COMPILED.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-AS400.
OBJECT-COMPUTER. IBM-AS400.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 EmployeeRec.
03 Name pic X(25).
03 MailAddress.
05 Street pic X(20).
05 City pic X(12).
05 State pic X(2).
03 Personal.
05 MaritalStatus pic X.
05 BirthDate pic X(8).
01 XMLMsg pic X(1000).
01 IFSFile pic x(50) value "/tmp/SomeIFSFile.xml"
PROCEDURE DIVISION.
POPULATE-EmployeeRec.
MOVE 'John Doe' TO Name.
MOVE '5th Avenue' TO Street.
MOVE 'Manhattan' TO City.
MOVE 'NY' TO State.
MOVE 'Y' TO MaritalStatus.
MOVE '19651231' TO BirthDate.

XML GENERATE FILE-STREAM IFSFile
FROM EmployeeRec
END-XML.
STOP RUN.


Cheers, Peter


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Sharon
Sent: Thursday, 20 November 2008 2:25 a.m.
To: rpg400-l@xxxxxxxxxxxx
Subject: Composing XML and RPG


Good morning all,



I have been working on how to decompose xml onto our ISeries for a
couple weeks now, the two XML opcodes have saved the day.



I am just wondering about the other side of the spectrum, composing
XML
documents. I have learned how to use the DB2 XML Extender, is that
the
preferable way to compose an XML document today? Are there any new
features in the same realm as these new opcodes for composing?



Thanks in advance,



Sharon
_________________________________________________________________
Windows Live Hotmail now works up to 70% faster.

http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_fas
ter_112008
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.


########################################################################
#############
This correspondence is for the named person's use only. It may contain
confidential or legally privileged information, or both. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this correspondence in error, please immediately delete
it from your system and notify the sender. You must not disclose, copy
or rely on any part of this correspondence if you are not the intended
recipient. Any views expressed in this message are those of the
individual sender, except where the sender expressly, and with
authority, states them to be the views of Veda Advantage. If you need
assistance, please contact Veda Advantage on either :- Australia 133124
or New Zealand +64 9 367 6200
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.