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



Hi, Pete --

I'm not really sure why you're calling getOutputDataLength(). This just
returns what you set with setOutputDataLength() (or in the constructor) in
the first place.

As for the value, you seem to be doing an awful lot of conversions. Try:

myPackedVar = ((BigDecimal)
myPackedParm.toObject(parms[5].getOutputData())).intValue();

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-
bounces@xxxxxxxxxxxx] On Behalf Of Pete Hall
Sent: Wednesday, November 04, 2009 5:41 PM
To: java400-l@xxxxxxxxxxxx
Subject: Re: Returning data with com.ibm.as400.access.ProgramCall

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

James Perkins wrote:
Yes it is. If you don't instantiate the object it's by default set to
null.
It would be luck passing *OMIT to an RPG program if you did not
instantiate
it.

You might not however need to create one for each parameter though.
Maybe
just one for each type. I would need to look into a bit more to be sure
on
that. I don't use program calls like this too often.

Ok. Thanks James. I know I need to instantiate the class. I was mainly
wondering if there wasn't a less kludgey way of getting the returned
value back into a java variable. I need to explain this to some folks
that might find

if (parms[5].getOutputDataLength() > 0)
myPackedVar = Integer.parseInt(
myPackedParm.toObject(parms[5].getOutputData()).toString());
}

a little counterintuitive. I was hoping that going from byte[] to string
to integer was a mistake. Maybe I can write a static function that will
clean it up a bit.

- --
Pete Hall
pete@xxxxxxxxxxxxxx


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.