Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2008-06-25
5
Medium Priority
?
2,258 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

715 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