× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Did you create the stored procedure definition on the remote machine?
The program also has to be on the remote machine. You will also need to
create an SQL package for the program that is connecting to the remote
machine or it will not work. Here's an example:

CRTSQLPKG PGM(mylib/mypgm) RDB(remotedb) USER(user) PASSWORD(password)

The CRTSQLPKG command must be run on the local machine.

Additionally, if you enter STRDBG UPDPROD(*YES) and then run your
program, the job log will give you detailed information about what's
happening.

Matt

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
Sarvapriya_Tripathi@xxxxxxxxx
Sent: Friday, June 15, 2007 12:37 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Calling a Pgm on a Remote i5 using RPG

Thanks for the reply Matt! Going by your suggestion, this is what I
wrote:

Program CALLEDPROC:

h Option( *SrcStmt ) DecEdit( *JobRun ) BndDir( 'QC2LE' )
h DatFmt(*YMD/) Timfmt(*HMS:) DftactGrp(*No) ActGrp(*New)
h ExprOpts( *ResDecPos )

d CALLEDPROC pr
d Parm1 5p 2
d Parm2 10a

d CALLEDPROC pi
d Parm1 5p 2
d Parm2 10a

/free
Parm2 = %editc(Parm1:'X');
*inLR = '1';
/end-free

Program CALLRMTPRC:

h Option( *SrcStmt ) DecEdit( *JobRun ) BndDir( 'QC2LE' )
h DatFmt(*YMD/) Timfmt(*HMS:) DftactGrp(*No) ActGrp(*New)
h ExprOpts( *ResDecPos )

d CALLRMTPRC pr

d CALLRMTPRC pi

d Parm1 s 5p 2
d Parm2 s 10a

/free
Parm1 = 5.32;
Parm2 = *Blanks;
/end-free

c/exec sql set option datfmt=*ISO, closqlcsr=*endmod, commit=*none
c/end-exec
c/exec sql
c+ connect to N09102A
c/end-exec
c/exec sql
c+ call QGPL/CALLEDPROC (:Parm1, :Parm2)
c/end-exec

/free
dsply Parm2 'FISISXT';
*inLR = '1';
/end-free


The program CALLEDPROC was used to create a stored proc using:

CREATE PROCEDURE QGPL/CALLEDPROC(IN PARM1 DEC (5, 2), OUT PARM2
CHAR ( 10)) LANGUAGE RPGLE NOT DETERMINISTIC NO SQL EXTERNAL NAME
QGPL/CALLEDPROC PARAMETER STYLE GENERAL


Now if I have CALLRMTPRC and CALLEDPROC both on the local machine, and I
remove the "connect to N09102A" section from CALLRMTPRC, I can call the
stored proc successfully and get the results back in PARM2. But, when I
put
in the "connect to" section in there (with user and password that I do
not
show here), I do not get any results back (PARM2 is blank).

Additionally, from STRSQL, if I connect to N09102A and do this:

CALL STOREDPROC (1.23, ' ')

I get:

STOREDPROC in *LIBL type *N not found.

Any suggestions?

Regds
Sarvapriya M Tripathi
************************************************************************
******

The information contained in this electronic communication and any
accompanying document is confidential, may be attorney-client
privileged,
and is intended only for the use of the addressee. It is the property
of
Ryder System, Inc. Unauthorized use, disclosure or copying of this
communication, or any part of it, is strictly prohibited and may be
unlawful. If you have received this communication in error, please
notify
the sender immediately by return email, and destroy this communication
and
all copies of it, including all attachments. Electronic communication
may
be susceptible to data corruption, interception and unauthorized
tampering
and Ryder disclaims all liability of any kind for such actions or any
consequences that may arise directly or indirectly therefrom.
************************************************************************
******

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.