calling RPG ILE with parameter list from MI

Denes L <denes1951-FFYn/[email protected]> Fri, 7 Dec 2007 19:26:49 -0500 (EST)
Newsgroups gmane.comp.lang.as400.mi
Message-ID <[email protected]>
Hello all,
I am trying to call an RPGLE pgm from MI passing parameters to it.

OS V5R2M0, QRPGLESRC file member contains:

D DM_910        E DS                  EXTNAME(DML910)
D                                     PREFIX(D910)
....
C     *ENTRY        PLIST                         
C                    PARM                    DM_910
....

DML910      *FILE     A550AP      PF          Parameter data structure fo

           Data        Field  Buffer    Buffer        Field    Column      
Field      Type       Length  Length  Position        Usage    Heading     
P1PRDC     CHAR           35      35         12        Both     Item
P1QTY      PACKED      15  3       8        64        Both     Order Qty
.... (45 fields)


First I tried this:
DCL SPCPTR $P1PRDC INIT(P1PRDC);
DCL DD P1PRDC CHAR(35);         
DCL SPCPTR $P1QTY INIT(P1QTY);
DCL DD P1QTY PKD(15,3);       
....
DCL OL CALLEE($P1PRDC, $P1QTY, ... ) ARG;
....

but if I debug the RPG and display the parameter values:
D D910P1PRDC                    35A   EXTFLD (P1PRDC)
D  D910P1QTY                     15P 3 EXTFLD (P1QTY)

I get garbage instead of the actual values loaded in the MI vars which should now be in the RPG vars:
EVAL DM_910 : X 128
00000     40404040 40404040 40404000 00000000   -            .....
00010     80000000 00000000 D91AD4CE 8100A100   - Ø.......R.Móa.~.
00020     40404000 00000000 00000000 00000000   -    .............
00030     80000000 00000000 D91AD4CE 8100A120   - Ø.......R.Móa.~.
00040     40404040 00000000 00000000 00000000   -     ............
00050     80000000 00000000 D91AD4CE 8100A140   - Ø.......R.Móa.~ 
00060     00000000 0F000000 00000000 00000000   - ................
00070     80000000 00000000 D91AD4CE 8100A160   - Ø.......R.Móa.~-
(these look like addresses instead of content at those addresses, hmm...)

If I change the OL to:
DCL OL CALLEE(P1PRDC, P1QTY, ... ) ARG;

and debug to display the vars again I get:
Pointer not set for location referenced.

I tried reading the available docs and mailing list msgs but no luck.
Does anybody know how can I accomplish this?.
Thanks,
Denes.
       
---------------------------------
Looking for a X-Mas gift?  Everybody needs a Flickr Pro Account!
_______________________________________________
This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/mi400
or email: MI400-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/mi400.