Solved

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

Posted on 2008-06-25
5
2,247 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

911 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now