You can call exported procedures via PCML or XPCML (see com.ibm.as400.access.ServiceProgramCall).

The "problem" with the restriction of 7 parameter is not really a restriction as you can work with (data) structures very nicely in PCML and I have yet to write a procedure which has to pass/get more that 7 parameters.

Date handling: Is not that much of a problem either. Just convert the date/timestamp to a unix timestamp which can be passed easily as an integer and is easily consumed by your java problem in the Date constructor as a parameter.

D unixEpochTimestamp...
D C z'1970-01-01-00.00.00.000000'

P date_convertDateToMillis...
P B export
D PI 20I 0
D pDate D const
/free
return %diff(%timestamp(pDate) : unixEpochTimestamp : *SECONDS) * 1000;
/end-free
P E


P date_convertMillisToDate...
P B export
D PI D
D millis 20I 0 const
*
D datum S D
/free
datum = %date(unixEpochTimestamp + %seconds(%uns(millis / 1000)));
return datum;
/end-free
P E

Note: It is not a real Unix timestamp as it originally counts in seconds not milliseconds as in this example but as java likes milliseconds it is gonna get it (see java.util.Date).

Regards

Mihael


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx] On Behalf Of James Perkins
Sent: Tuesday, April 20, 2010 6:35 PM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] PCML use

I've started using PCML more because I hate defining the stored
procedure. I do agree that SQL stored procedures are more flexible and
platform-independent, but since at this point I only create programs
that will be calling IBM i programs it hasn't affected me. I think you
can even call service programs with PCML, so that's a bonus.

I do wish however that PCML had better date support. The data handling
is one nice thing about SQL stored procedures.

--
James R. Perkins



On Tue, Apr 20, 2010 at 06:16, <TAllen@xxxxxxxxxxxx> wrote:
Just for my edification, what is/are the use case(s) for PCML vs. SQL
stored procedures?  I've never seen the need to use PCML and don't know why
I ever would use it.  SQL stored procedures seem to be more flexible and
platform-independent.

Thanks,
Todd Allen
EDPS
Electronic Data Processing Services
tallen@xxxxxxxxxxxx



This communication and any transmitted documents are intended to be confidential. If there is a problem with this transmission, please contact the sender. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited.

--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.



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.