|
Sharon,that
Given that IBM ships a COBOL compiler with the iSeries, this means
it is available for specific ILE modules other than RPGLE just as youand
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
run PDM option 14.RPGLE.
However, it would take a little more COBOL skill to determine if this
could effectively be integrated as a procedure to be called from
XML
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
documents. I have learned how to use the DB2 XML Extender, is thatthe
preferable way to compose an XML document today? Are there any newhttp://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_fas
features in the same realm as these new opcodes for composing?
Thanks in advance,
Sharon
_________________________________________________________________
Windows Live Hotmail now works up to 70% faster.
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 containconfidential or legally privileged information, or both. No
--list
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
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 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.