Title: Message
Well, I tried to create a simple example but i'm not an RPG programmer either!  I'd have to get my team to help out with it, but since we're not on the clock....I'll try to wrap it up :)
 
Here's the outline of our methods..
 
1) Create SQLRPGLE program (new RPG with embedded SQL) that returns the result set through a cursor
2) Create Stored Procedure definition for the RPG program
3) Call Stored Procedure from Cold Fusion
 
Here's a PDF I found that has a lot of similar info:
 
To answer your previous questions...
-CL is a batch type language that usually precedes RPG programs.
-Create Procedure creates the external definition, so you can call the procedure on the 400.
-How to output? That particular code just sends a parameter and gets a result back..I think you can use CFQUERY to call the stored procedure in order to be able to output the data.
 
Better Answer -- Can you just access the AS/400 files directly, through Client Access ODBC and pass in the customers id number?  That's the easiest way to address this....works great.
 
ie..
<CFQUERY NAME="qry" DATASOURCE="as400">
SELECT name FROM AS400LIBRARY.AS400TABLE WHERE customer = #Form.Customer#
</CFQUERY>
 
Feel free to follow up with me directly..I'll try to help if possible.
 
-David
-----Original Message-----
From: Ron Mast [mailto:[EMAIL PROTECTED]
Sent: Thursday, January 20, 2005 9:09 AM
To: [email protected]
Subject: RE: call an RPG program

Hi David,

Yeah, I'm going to need more details.  I'm sorry, I have never done this before...L  CL?  I'm not a RPG programmer, so CL is the avenue.  

 

What does this do?

Create Procedure LIBRARY/CLPROGRAM(INOUT RunOption CHAR (12))
 Language CL  Not Deterministic  No SQL  External Parameter Style General                              

 

How would I output this?

<CFSTOREDPROC PROCEDURE="LIBRARY.CLPROGRAM" DATASOURCE="AS400">
    <CFPROCPARAM TYPE="InOut" CFSQLTYPE="CF_SQL_CHAR" VARIABLE="batchstatus" VALUE="Start">
</CFSTOREDPROC>

 

Thanks a lot!

Ron

 

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lewis, David
Sent: Wednesday, January 19, 2005 3:47 PM
To: '[email protected]'
Subject: RE: call an RPG program

 

Here's what we did with our AS/400 --

 

Create stored procedures out of your CL programs by running a CREATE PROCEDURE command in the Interactive SQL area (STRSQL).  You can probably find out what all the options are by looking up the create procedure command in an AS/400 SQL manual.  You have to run this each time you recompile your program, I believe.  You may also be able to use RPG programs if you want to skip the CL.

 

Example CREATE of CL program that takes a 12 character parameter:

 

Create Procedure LIBRARY/CLPROGRAM(INOUT RunOption CHAR (12))
 Language CL  Not Deterministic  No SQL  External Parameter Style General                              

 

Example of calling that stored procedure from CF:

 

<CFSTOREDPROC PROCEDURE="LIBRARY.CLPROGRAM" DATASOURCE="AS400">
    <CFPROCPARAM TYPE="InOut" CFSQLTYPE="CF_SQL_CHAR" VARIABLE="batchstatus" VALUE="Start">
</CFSTOREDPROC>

 

I'm not enough of a guru to explain it thoroughly, but that should get you started if you want to try this route.  Let me know if you need more details and I can pull some more code :)

 

-David

-----Original Message-----
From: Ron Mast [mailto:[EMAIL PROTECTED]
Sent: Wednesday, January 19, 2005 2:38 PM
To: [email protected]
Subject: call an RPG program

Hi All,

I am pulling from an AS400 (Mainframe) database.  We are a manufacturing company so prices differ from customer to customer.  Our customers login and based on their customer number they only see items that they have purchased in the past with current prices.  Not so current though because the file I pull from was built last night.  There lies the problem.  We want to build this file as soon as the customer logs in.  It would simply take too long to build the file in CF, that is the reason why we are not doing it that way.  Does anyone know how to call an RPG program in CF?  The RPG program's purpose would be to build the file. 

 

Ron      

Reply via email to