• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

RPG to OW..!!

vliyer

Active Member
Hi,
We are in the process to figure out how to call OW business function from
RPG program on AS/400.
I was trying to write this C program (on AS/400) (which I am planning to
call from RPG) to connect to ow, call business function and disconnect from
OW.

I found this piece of code to connect to ow in Inter..Guide.

HENV hEnv=NULL;
HUSER hUser=NULL;
JDEDB_RESULT rcode;
char szEnv[11] = "Environment"; /* ENVIRONMENT */
char szUser[11] = "User ID";
char szPwd[11] = "Password";
if ((rcode= JDB_InitEnvOvr(&hEnv,szEnv,szUser,szPwd))!=JDEDB_PASSED)
{
printf("JDB_InitEnvOvr failed.\n");
return (0);
}

How will I add Include directives for JDE header files for e.g. for "jde.h"
etc. ??

I hope without including missing directives (???) this code is not going to
compile.

1-800-JDELIST , Please help..!!

TIA,
Rgds,
venkat.
 

ka4niv

Active Member
We use RUNUBE command on the 400 -- will that help?

M Rice
XE sp14.1, ES:400, DS:NT, Formscape, Citrix

----- Original Message -----
From: "vliyer" <vliyer@hotmail.com>
To: <jdeowdevml@jdelist.com>
Sent: Wednesday, August 01, 2001 1:27 PM
Subject: RPG to OW..!!


from
"jde.h"
to
 

WhippingBoy

VIP Member
(ralph wiggums) I have a cat named mittens. . .(/ralph wiggums)



D'oh!. . I couldn't resist. . .forgive me.


Ahem. . do a WRKOBJ on the file 'H'. You'll see there are different header files in a number of places. For the JDE stuff pay attention to your system directory. Ours is B7332SYS for example.

Darren Ricciardi - OneWorld Whipping Boy

Looking for work in Amsterdam THE NETHERLANDS
 

vliyer

Active Member
Hi Darren,
Thanks a lot. Atleast it could compile with jde.h in pgm and B7333SYS in
library list (our library for H file).
I will proceed and update forum with status.
I also have the source you have provided (couple of days back in forum) to
try on..!!

Thanks again,

Rgds,
venkat.
 

vliyer

Active Member
Hi Darren,
It went through upto defining HENV,HUSER,JDEDB_RESULT.
Now it's giving error on JDB_InitEnvOvr and JDB_InitUser
as "Defination not found for symbol JDB_InitEnvOvr" (same for User).

I also included <jdekprto.h> which has these definations but no luck.

Am I missing something??


TIA,
Rgds,
Venkat.
 

WhippingBoy

VIP Member
Ok, this is where you're on uncharted waters since I haven't done this on the AS/400. But, what you're missing is in the link phase of the compile. You need to specify jdekrnl.lib during linking to get that symbol resolved. I'm guessing that on the 400 you need to link with the JDEKRNL SRVPGM in your sys directory, but you'll have to experiment. . . .or call JDE (shudder).

Let me know how it works out.

Darren Ricciardi - OneWorld Whipping Boy

Looking for work in Amsterdam THE NETHERLANDS
 

vliyer

Active Member
Hi Darren,
Thanks a lot. It went through. I don't know what was the problem with
variable definations. Initially it wasn't working. When I changed
char szEnv[11]="DV7333" to char *szEnv="DV7333" it worked. Today I changed
it back to first one -to check if it works..it's working..!

?????

nway, it could call the bsfn .

Thanks for your help.

one strange thing I noticed is even after releasing env,user,bsfn parameter
list functions..(as per your code), it's still not allowing me to call the
same function twice. I have to logoff from as/400 signon screen and log back
in.
Is there any additional step you think I need to resolve this??


Thanks again,

Rgds,
Venkat.
 
Top