Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How Do I Call An RPG Program From An iSeries Stored Procedure?

Posted on 2008-06-25
5
Medium Priority
?
2,259 Views
Last Modified: 2011-10-19
I need to be able to call an RPG program from an iSeries Stored Procedure.  The program that we have is that when the procedure is called an error is returned that the program cannot be found in the library.  We are calling the procedure from a .NET application.  We are able to run other procedures that query the files directly by setting the DefaultCollection.  However, this doesn't seem to resolve a call to an RPG program.  Any ideas?  I have included the procedure we created that calls the RPG program.
CREATE PROCEDURE BP_P55GMAPOST(
	IN BatchNo 	CHAR(50),
	OUT Error 	CHAR(50)
) 
LANGUAGE RPGLE
MODIFIES SQL DATA
CALLED ON NULL INPUT 
EXTERNAL NAME P55GMAPOST
PARAMETER STYLE GENERAL WITH NULLS

Open in new window

0
Comment
Question by:agorsky73
5 Comments
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 21873144
Hi Agorsky,

I did it some time ago, dont ask me how it works and why, (I don't know nothing of ASP or .NET)
but I dont care it worked so mission completed.

I had a big help at this link:
http://www.netsplore.com/PublicPortal/Default.aspx?tabid=246

Good Luck,
Murph
0
 

Author Comment

by:agorsky73
ID: 21875658
I read that article but that solution won't work for me. That solution requires the use of ActiveX and I need to stick with the ADO.NET provider.  Ultimately the issue isn't .NET because we receive an error if we run the stored procedure on the iSeries from iSeries Navigator.
0
 
LVL 16

Expert Comment

by:theo kouwenhoven
ID: 21875786
If you receive an error on the call, it could be possible that the one of the involved objects was not found, did you set a librarylist?
0
 
LVL 27

Accepted Solution

by:
tliotta earned 2000 total points
ID: 21880948
agorsky73:

This statement:

   EXTERNAL NAME P55GMAPOST

...provides the external program name, but it says nothing about where it exists. Consider changing the definition either to:

   EXTERNAL NAME library.P55GMAPOST

or:

   EXTERNAL NAME library/P55GMAPOST

Replace [library] with the library name where P55GMAPOST was created.

Murph might also have given a correct answer. You might be successful if you set your library list before making the call. That requires knowing what list to set, of course.

Tom
0
 

Expert Comment

by:cesarguru_ES
ID: 26074842
In the tag Server, of the coneccion ODBC that uses the program, is a texbox, called a List of Libraries, there it is necessary to put the libraries where there are the programs that are used, separated by comma or space.
ODBC.GIF
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Take a look at these 6 Outlook Email management tools which can augment the working and performance of Microsoft Outlook to give you a more rewarding emailing experience.
Your business may be under attack from a silent enemy that is hard to detect. It works stealthily in the shadows to access and exploit your critical business information, sensitive confidential data and intellectual property, for commercial gain. T…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question