I'm passing a struct that contains fields of various datatypes, including
packed decimal, from a RPG program to a C++ srvpgm. The issue is that the
decimal fields are received on the C++ side as zoned decimal, not as packed
decimal. I haven't found anything in the Programmer's guide explaining this
Here's the RPG prototype:
d functionA pr 10i 0 extproc(*CWIDEN: 'functionA__+
d headerrec likeds(headerrec) const
Here's the C++ prototype:
int functionA (FRDDTAD_ONLHDRA_ONLHDRA_both_t *prec);
The struct on the C++ side corresponds to a database file record and has
been created with GENCSRC, i.e the decimal members are of the _DecimalT type
and should work fine with packed decimal data.
For testing purposes I created another C++ srvpgm that was passed 2 parms, a
packed decimal and a char array by reference from RPG. That worked. So
there's something with packed decimal inside a datastructure that I don't
know about. Any ideas on what that is?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2021 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
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.