Plex 2E

  • 1.  Integer output from Plex RPG program

    Posted Nov 17, 2015 03:57 PM

    Does anyone know if it is possible to output an integer from a Plex generated RPG program?  I don't see "integer" as an available AS400 format.  We are using Plex 6.1.

     

    Let me explain why I need an integer data type.  Currently we use the Web Service wizard in RDi to create web services from our Plex RPG programs.  This wizard uses something called a PCML file to define the parameters for the RPG program.  It then generates a Java wrapper to implement the web service.  When my RPG program outputs a multiple occurrence data structure of say 100 records, the XML that is returned to the caller contains 100 instances regardless of whether they contain any data.  Apparently, if you have an output parameter of type integer that contains the record count, the generated Java will only generate XML for the number of records being returned.

     

    Dean Eshleman,

    Everence Financial



  • 2.  Re: Integer output from Plex RPG program
    Best Answer

    Posted Nov 18, 2015 01:48 AM

    Hi Dean

     

    No Apparently! It works great but as you have found out you need to ouput an integer and something else you will find out is it has to be a true OUTPUT field and not STRUCTURED ouput containing your integer. So it is a bust on two fronts

     

    But the functionality offered was too good to be missed so I edit the source after generation. This is the only way and I talked about it here Consume & Publish Webservices from IBMi - Solved

     

    But it is well worth the hassle and calling tiers perceive you better



  • 3.  Re: Integer output from Plex RPG program

    Posted Nov 18, 2015 10:12 AM

    Hi George,

     

    Thanks for the information.  I was pretty sure it couldn't, but I didn't know if there was a trick I was missing.  I was wondering if it could handle the field being in a structure, so I'm glad you confirmed that. 

     

    So, when you edit the source do you end up adding a new field as an output parameter and move the value from the existing field or do you change the existing field definition to 10I 0 and move it out of the data structure?

     

    Now that I think about it, I could use RPG source code in the PLEX model to define the integer field.  I could also use source code to set the value of the integer field equal to the RowsFetched.  That way, the only change to the generated RPG is to add the integer field to the PLIST.  Maybe that is what you did.

     

    The other challenge for me is to fix my PCML generation pattern to output the new integer field.  I'll have to think about how to do that.

     

    Dean Eshleman,

    Everence Financial



  • 4.  Re: Integer output from Plex RPG program

    Posted Nov 18, 2015 12:33 PM

    Exactly Dean,

     

    You can patternize everything up to the plist. Was going to create model api tool to do it but then thought why bother since there is no one in the world listening. Would have been an absolute folly much like StellaTools and CA Plex.



  • 5.  Re: Integer output from Plex RPG program

    Posted Nov 18, 2015 05:09 PM

    I started on the pattern, and it is pretty easy to do as you well know.  Generating the PCML correctly will be a little more work.  Thanks again.

     

    Dean Eshleman,

    Everence Financial