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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PB6.5 need to call as400 program with parms

Status
Not open for further replies.

Denwich

Programmer
Feb 25, 2010
3
US
Using PB6.5 version. Need to call as400 program passing parms and getting 2 parms returned. Any samples on how to do this? I've looked at the iseries and have tried that but getting errors. I've also tried using ole/db but have problems with setting up ole automation. The following shows an example with Powerbuilder, but uses a newer version of PB...
Any help would be most appreciated!!!

Thanks,
Denise
 
Several years ago I worked at a place and we (someone else, not me) wrote a java 'wrapper' for an as400 call. I can't give you any more specifics - just passing on the idea.

Matt

"Nature forges everything on the anvil of time
 
Hi

We had few cobol prgorams as compiled in DLLs. Here are few instructions:

1. Publish your AS400 programs as DLLs.
2. Paste it in your Source directory.
3. Declare local ext function referring to those DLL.
eg: FUNCTION int LIFE(REF int a, REF string as_sqlerrmc, REF string b, REF string c, REF string d, REF string e) LIBRARY "LIFE.DLL" alias for "LIFE;Ansi"
4. Call them in your program like a normal function call:
rtn = LIFE(a,b,c,d,e)

for more please go to PB Help and see "external functions"

Thanks


 
this is how it is defined:

FUNCTION uint cwbRC_AddParm(Ref ulong pgmhandle, string parmtype, ulong parmlength, string parameter) LIBRARY "cwbrc.dll"


ls_program = "CALCTAXADP"
ls_library = "JPELLA"

li_rtncde = gnv_app.inv_as400.of_logon_as400()

li_rc = gnv_app.inv_as400.cwbrc_CreatePgm(ls_program,ls_library,ll_pgmhandle)
if li_rc <> 0 then
Messagebox("Error creating program handle for CALCTAXADP.", " pgmhandle = " + string(ll_pgmhandle) + " rtn= " + string(li_rc))
end if
ls_type = 'CWBRC_INPUT'
ll_length = 15

string ls_parm
ls_parm = string(ldc_totbilled)
li_rc = gnv_app.inv_as400.cwbrc_AddParm(ll_pgmhandle, ls_type,ll_length, ls_parm)


**** I get a return code of 6001 when calling cwbrc_AddParm


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top