This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Thanks for the tips, James. However, the ServiceProgramCall class API says that a max. of 7 parameters may be passed to the service program. In my program, I may have to pass more params. Have any idea how to handle that?
Joined: Jun 26, 2001
Well that kind of sucks doesn't it ;-) How about using ProgramCall object then, it apparently allows 35 parameters to be passed to the program. The only catch being now, the main entry/exit point would be the main line of code in the RPG program (*ENTRY and *PARMLIST part), rather than just a specific method. James.
Anthony_Castillon Welcome to the Java Ranch, we hope you�ll enjoy visiting as a regular however, your name is not in keeping with our naming policy here at the ranch. Please re-register under an appropriate name as shown in the policy. Thanks again and we hope to see you around the ranch!!
------------------ Dave Sun Certified Programmer for the Java� 2 Platform
Thanx for the tips, James. Have a question though: Do I have to do any configuration of my system (I'm running a java app from Windows 2000 connected to an AS400 machine) to make the connection. The ProgramCall API and samples I've seen so far looks deceivingly simple or has IBM really abstracted away the fine details of the connection (given that the fully integrated file name has been provided) that I just have to use the setProgram() and run() on the AS400 object?
Originally posted by james swan: Well that kind of sucks doesn't it ;-) How about using ProgramCall object then, it apparently allows 35 parameters to be passed to the program. The only catch being now, the main entry/exit point would be the main line of code in the RPG program (*ENTRY and *PARMLIST part), rather than just a specific method. James.
Joined: Jun 26, 2001
Hi Anthony, yeah it is pretty simple to set up the client (Windows 2000 side). Just have the jt400.jar in your classpath, and so long as you can see the AS400 on the network (and have a valid AS400 user profile), you should be fine. From the AS400 side, somebody might have to install some of the IBM java support programs (but don't quote me on this). check out this link for more info: http://publib.boulder.ibm.com/html/as400/v5r1/ic2924/info/rzahh/rzahnm05.htm#HDRRZAHNRE2-RE2RF here is a simple example of a CL program call to get you started. the CL program (get someone to compile it for you, or maybe you can just do it yourself)
the java class that calls it
You might need to adjust these slightly for your environment, in particular the name of the AS/400 you want to connect to, and the library and program name of the CL program. I don't work on the AS/400 platform anymore, so that's about my limit of being able to help you. Basically (after maybe program/class compile issues), if you can't run this successfully then the AS/400 might not have the necessary supporting software installed (see the above url). Hope this helps, James.
Joined: Nov 30, 2001
I created a class and patterned it after the sample code in the ProgramCall API. I also created a client that populates an array of AS400Parameter(which I created) and called on my program. It worked. Thanx again for the tips.