Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to code a Variable lenghth Entry parm via Proceder Interface

Status
Not open for further replies.

EMSS

Programmer
Jan 14, 2003
4
US
I have written code to pass parameters to a stored procedure from VBA code in Excel. Works fine. However, problem is parms sent and returned need to be variable leghth.

I have scoured the internet trying to find anything that is close.

I have found that the Options(*varsize) can be used in an RPGLE main module with a PI Program Interface. Here is some code I've put together...it is incomplete, but if any one could finish out the source, i can take it from there.

So far, I have not even been able to compile this one. New to Sub Procedure usage... so please excuse my ingnorance.

How do I compile the source, and how is it called. Just a basic template program will be sufficient.

One more issue before you get too involved - can Parm2 be a returned parm? Important - Excel uses returned parm for further processing.

* Prototype for Procedure
D Tst05r PR 5U 0
D Parm1 72A Options(*VarSize) Const
D Parm2 72A Options(*VarSize) Const
D Parm3 100A Options(*VarSize) Const
D Parm4 100A Options(*VarSize) Const
* Procedure Inteface to Entry Parms
P Tst05r B
D Tst05r PI 5U 0
D Parm1 72A Options(*VarSize) Const
D Parm2 72A Options(*VarSize) Const
D Parm3 100A Options(*VarSize) Const
D Parm4 100A Options(*VarSize) Const
C*




 
I am assumine you are using a max size. I believe there is the

VARYING
Specify this keyword on any character or
graphic field definition, to indicate
that the field can have both a maximum
length and a current length.

Would this help

D char S 100 varying iSeriesCodePoet
IBM iSeries (AS/400) Programmer
[pc2]
 
already tried varying - does not work. Still have corrupt parm data when opened using debug. IBM states must use option(*varsize) for variable entry parmameters.
 
Not sure then... sorry I can't help more. :-( iSeriesCodePoet
IBM iSeries (AS/400) Programmer
[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top