Re: PCML Structure length

Barbara Morris <[email protected]> Mon, 8 Aug 2022 18:51:14 -0400
Newsgroups gmane.comp.lang.as400.java
Organization IBM
Message-ID <[email protected]>
On 2022-08-05 12:20 p.m., Pete Helgren wrote:
> Working with a PCML call that I *almost* have working....the issue seems 
> to be that one of the parameters is the length of the structure which I 
> am not sure how to calculate/get.  The API being called is:
> 
> https://www.ibm.com/docs/en/i/7.4?topic=ssw_ibm_i_74/apis/qycdrnwc.htm 

In this example of calling QSYRUSRI, they call getOutputSize() to get 
the size of an output parameter.

https://www.ibm.com/docs/en/i/7.4?topic=ssw_ibm_i_74/rzahh/pcmldata.htm#pcmldata__pcmlqsyrusri

Assuming getOutputSize() only works with usage="output", maybe you could 
define another dummy program with the struct defined with 
usage="output", and get the size of that parameter.

Something like this, a bit kludgy, but maybe it will work ...

   <program name="rnwc0300Size">
     <data name="rnwc" type="struct" struct="rnwc0300"
           usage="output"/>
   </program>

   ...

   pcml.setValue("qycdrnwc.reqdataLength",
                 pcml.getOutputsize("rnwc0300Size.rnwc"));


-- 
Barbara

-- 
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/java400-l.

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