× 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 Niels,

I didn't remember it, but I discovered this technique many years ago in a
Rory Hewitt utility.

My doubt remains whether the system will create the operational descriptor
in the specific case of a data structure with null indicators.

With Jon's comment and reviewing Rory's utility, I have the impression that
the operational descriptor will not be created.

I will make some tests. Thanks for the idea Niels.

Javier Mora

El vie, 18 feb 2022 a las 18:25, Niels Liisberg (<nli@xxxxxxxxxxxxxxxxx>)
escribió:

If you are realy hardcore, the you can get direct acces to the
"invocation-record" - the info on the stack, placed by the "calling
procedure".

I do this all the time when I make API's for RPG written in C since it does
not have %parms or alike.

I have made these headers / prototypes, but they can easily be refactored
to RPG.

https://github.com/sitemule/noxDB/blob/master/headers/ext/parms.h

It is this build in OS vector that does the magic:

PNPMPARMLISTADDRP _NPMPARMLISTADDR (void);

Here is the prototype:
---------------------------

typedef _Packed struct _OPDESC {
SHORT DescType;
SHORT DataType;
SHORT DescInf1;
SHORT DescInf2;
LONG DataLen ;
} OPDESC , * POPDESC;

typedef _Packed struct _OPDESCLST {
LONG NbrOfParms;
UCHAR filler1[12];
UCHAR filler2[16];
POPDESC OpDesc [400];
} OPDESCLST , * POPDESCLST;

typedef _Packed struct _NPMPARMLISTADDRP {
POPDESCLST OpDescList;
UCHAR filler[16];
PUCHAR Parms;
} NPMPARMLISTADDRP, * PNPMPARMLISTADDRP;

#ifdef __ILEC400__
#pragma linkage (_NPMPARMLISTADDR, builtin)
#pragma argument (_NPMPARMLISTADDR, nowiden)
#else
extern "builtin"
#endif

PNPMPARMLISTADDRP _NPMPARMLISTADDR (void);


Here is an example;
------------------------

PJXSQL jx_sqlOpen(PUCHAR sqlstmt , PJXNODE pSqlParmsP, BOOL scroll, LONG
formatP)
{

PNPMPARMLISTADDRP pParms = _NPMPARMLISTADDR();
PJXNODE pSqlParms = (pParms->OpDescList->NbrOfParms >= 2 ) ?
pSqlParmsP : NULL;
LONG format = (pParms->OpDescList->NbrOfParms >= 3 ) ? formatP :
0;

... etc etc..


It shows btw the ILE has a limitation of 400 parameters - good to know :)

On Wed, Feb 16, 2022 at 5:43 PM Jon Paris <jon.paris@xxxxxxxxxxxxxx>
wrote:

The OpDesc feature has never been fully implemented. According to the
docs ...

"The ILE RPG compiler only supports operational descriptors for character
and graphic types. Operational descriptors are not available for arrays
or
tables, or for data of type numeric, date, timestamp, basing pointer or
procedure pointer."

So I'm not exactly surprised that this doesn't work.

Have you opened a ticket with IBM to establish if this is a formal
limitation?


Jon P.



On Feb 16, 2022, at 6:56 AM, datil400 <datil400@xxxxxxxxx> wrote:

Thanks Chris for your comments.

I have made several tests with the CEEDOD and CEEGSI APIs with
different
types of parameters. When I specify a data structure with null
indicators
it always throws the error CEE0502 Missing operational descriptor.

If I remove OPTIONS(*NULLIND) keyword parameter, the operational
descriptor
is created. The compiler may not be able to build an operational
descriptor
of a data structure with nulls.

Best regards.

Javier Mora

El lun, 14 feb 2022 a las 22:07, Hiebert, Chris (<
chris.hiebert@xxxxxxxxxxxxxx>) escribió:

Well since it's a data structure, maybe try CEEDOD instead of CEEGSI.

This is because CEEGSI appears to be for Strings, and CEEDOD is for
any
data type.

Also, you didn't list the Proto type "PR". You should verify that it
also
includes the OPDESC keyword.


Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the
author
and do not necessarily represent those of the company.

From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
datil400
Sent: Thursday, February 10, 2022 2:22 AM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: Operational descriptor and data structure parm with nulls


Hi,



I am using operational descriptors (opdesc) for check data structure
parm

length in subprocedure. This technique works quite well with standard
data

structures. But when the data structure is specified with nulls the

descriptor is not passed to the subprocedure.



for example, when I use the CEEGSI API to get operational descriptor

information I receive the error message CEE0502.



The source code



D FACEMI_alias_t...

D E DS extname(FACEMI) alias

D qualified template



P initialize...

P B export

D PI opdesc

D r likeds(FACEMI_alias_t)

D options(*NULLIND)



D type S 10I 0

D len S 10I 0

D size S 10I 0



CEEGSI(%parmnum(r): type: len: size: *OMIT);

r5_assert(size = %size(FACEMI_alias_t): LEVEL_ERROR);



Is it possible to pass the operational descriptor for a data structure
with

nulls?



Thanks,



Javier Mora
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.