Solved

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

Posted on 2008-06-25
5
2,257 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 500 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
Choosing a core focus or particular set of features and options can be tough. To help out, we’re going to highlight a handful of things your business needs on one of your social media pages. In other words, if one of these is missing, you should imp…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

617 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