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

Calling an RPG Program from Java

Status
Not open for further replies.

Fooch

Programmer
Dec 19, 2005
63
0
0
US
I have a java web app running on a Tomcat server. And I am trying to call an RPG program that exists on an AS400 and pass it parms. I can do this with the CommandCall method and passing it an AS400 object. And then using the .run method to create a CL string to call an RPG program. The problem is, that the parms that get passed in are incorrect.

It has to do with the value of a field being declared as 45 long in RPG and it only containing 7 chars in java. The parm in the RPG contains those 7 characters and also contains other values from other parms. Almost like Java is passing a reference, not a value.

Is there a better way to call an RPG Program from a Java Web App? I read something about PCML but not sure exactly what that is. Thanks for any help.
 
Hi Fooch,

For Calling AS/400 programs from Java (in our case COBOL) we are using (since 2004 or 2005) PCML and jt400 and it works without problems.
PCML (Program Call Markup Language) is an XML-interface for calling programs on AS/400. This interface can be generated automatically by ILE compilers (in our case CRTBNDCBL and in your case CRTBNDRPG).

Read about it in IBM manuals and redbooks:
* IBM Toolbox for Java
* ILE RPG Programmer's Guide
* AS/400 XML in Action (PDML and PCML)
or google for other sources.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top