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



Try redefining the PF record to be used on a sub proc call and then compile
the program with PCML turned on and see what you get. See below for an
example

fCUSTMST uf a e k disk prefix('CM.')
d CM e ds qualified extname(CUSTMST)

...

//------------------------------------------------------------------------
// @Author: Aaron Bartell
// @Created: 2007-06-08
// @Desc: Retrieve a customer record.

//------------------------------------------------------------------------
p Cust_getRec b export
d Cust_getRec pi
d pError like(Cust_Error)
d pCustRec likeds(CM)
d pCustNbr like(CM.CUSTNBR)
/free

clear pError;
clear pCustRec;
chain(n) pCustNbr CUSTMST;
if not %found;
pError = 'Customer Not Found';
else;
pCustRec = CM;
endif;

/end-free
p e


CRTRPGMOD MODULE(AARONLIB/CUSTFN) SRCFILE(AARONLIB/qsource) SRCMBR(CUSTFN)
OPTION(*EVENTF) DBGVIEW(*SOURCE) REPLACE(*YES) PGMINFO(*PCML)
INFOSTMF('/home/aaron/custfn.pcml')


<pcml version="4.0">
<struct name="CM">
<data name="CUSTNBR" type="packed" length="5" precision="0"
usage="inherit" />
<data name="FNAM" type="char" length="15" usage="inherit" />
<data name="LNAM" type="char" length="15" usage="inherit" />
<data name="CMPNY" type="char" length="20" usage="inherit" />
<data name="ADR1" type="char" length="20" usage="inherit" />
<data name="ADR2" type="char" length="20" usage="inherit" />
<data name="CTY" type="char" length="15" usage="inherit" />
<data name="STT" type="char" length="2" usage="inherit" />
<data name="ZIPCD" type="char" length="5" usage="inherit" />
<data name="PHN" type="char" length="18" usage="inherit" />
</struct>
<program name="CUST_GETREC" entrypoint="CUST_GETREC">
<data name="PERROR" type="char" length="50" usage="inputoutput" />
<data name="PCUSTREC" type="struct" struct="CM" usage="inputoutput" />
<data name="PCUSTNBR" type="packed" length="5" precision="0"
usage="inputoutput" />
</program>
</pcml>

Really, if you were to create a PF with every possible data type and then
compile an RPG program from it, you could theoretically have everything
needed to create PCML on your own outside of the RPG compiler.

HTH,
Aaron Bartell
http://mowyourlawn.com

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx]
On Behalf Of David Gibbs
Sent: Thursday, June 28, 2007 12:59 PM
To: Java Programming on and around the iSeries / AS400
Subject: PCML structures based on database files?

Folks:

Does anyone know if there is a way to use database files to define PCML
structures?

I wrote a rather nice set of routines that will transfer data from a RPG
program to java, using a data queue ... the RPG program uses an externally
describe data structure (based on a database file) to send the data to the
queue.

The RPG program uses RFML to extract the data from the queue ... and the
RFML is constructed using the same database file that the RPG program uses
for it's data structure.

I would really like to be able to define PCML structures the same way ... so
I can define a RPG data structure using an database file, and have the PCML
defined using the same database file.

Any ideas?

Thanks!

david
--
System i ... for when you can't afford to be out of business
--
This is the Java Programming on and around the iSeries / AS400 (JAVA400-L)
mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/java400-l.


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.