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

I am using PCML to call a program which takes a struct, some of the struct
members are input parameters, and some are output only.  However it seems
that PCML does not understand and/or use the usage attribute of "data" or
"struct" when they are not top-level arguments specified under "program".
For example, when using the following PCML:

<struct name="someStruct">
     <data name="memberA" type="char" length="1" usage="input" init="X"/>
     <data name="memberB" type="char" length="1" usage="output"/>
</struct>


<program name="someProgram" path="somePath">
     <data name="someParameter" usage="inputoutput" type="struct" struct
="someStruct"/>
</program>

You get the following exception:

com.ibm.as400.data.PcmlException: Value is not set. Processing <data>
element 'someProgram.someParameter.memberB'.
     at com.ibm.as400.data.PcmlDataValues.toBytes(PcmlDataValues.java:475)
     at com.ibm.as400.data.PcmlData.toBytes(PcmlData.java:984)
     at com.ibm.as400.data.PcmlData.toBytes(PcmlData.java:974)
     at com.ibm.as400.data.PcmlProgram.callProgram(PcmlProgram.java:570)
     at com.ibm.as400.data.PcmlDocument.callProgram(PcmlDocument.java:378)
     at
com.ibm.as400.data.ProgramCallDocument.callProgram(ProgramCallDocument.java:247)
     at TestCall.main(TestCall.java:32)
Exception in thread "main"

I didn't expect this to happen, as memberB is an output parameter.  The
reason seems to be that only com.ibm.jt400.data.PcmlProgram.callProgram()
checks the usage attribute, if you look at lines 551 you can see it skips
calling PcmlStruct.toBytes() where usage = "output".  If the struct usage
is "input" or "inputoutput" then it calls PcmlStruct.toBytes() (line 554).
This method just iterates over the members of the struct and calls toBytes
() on them, without checking if they are input or output.  Hence the usage
attribute on memberB above is ignored and the exception occurs in
PcmlData.toBytes().


Is this the desired behaviour?  Any comments or suggestions welcome :)

Regards,


Niall



The information contained in this e-mail is confidential and
may be privileged. It  is intended only for the addressee(s)
stated above. If you are not an addressee, any use,
dissemination, distribution, publication, or copying
of the information contained in this e-mail
is strictly prohibited.

If you have received this e-mail in error, please immediately
notify us by telephone at 353-1-6610600 or e-mail
Helpdesk@xxxxxxxxxxxxxxx and delete the e-mail
from your system.

Thank you for your co-operation.
**********************************************************************


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.