Solved

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

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
A safe way to clean winsxs folder from your windows server 2008 R2 editions
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

705 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

19 Experts available now in Live!

Get 1:1 Help Now