× 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.



Wes,

If the error is caused by the return statement, it means that your 
variable 'PgmName' is not properly defined at runtime. 'PgmName' is based 
on a pointer and that pointer does not contain a (proper) value. How is 
PgmName defined? Could it be that it is an external parameter that was not 
passed?

Joep Beckeringh






"Wes" <destaw@xxxxxxxxxxxxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
16-12-2005 22:51
Please respond to RPG programming on the AS400 / iSeries
 
        To:     rpg400-l@xxxxxxxxxxxx
        cc: 
        Fax to: 
        Subject:        Calling RPGLE subrotine from SQL Proc with retrun 
value


Hi List,

I'm trying to find out what program is changing a closed sale. The file is
updated from by various programs by calling a file server so the audit 
file
keeps pointing to the file server program. I've found a nice RPGLE program
that uses the QWVRCSTK API to list the call stack (from iSeries News web
site). I've modified the program so it would only return the interactive
program. The problem I'm having is with the SQL procudure. I have created 
a
SQL exteranal proc:

Create procedure Datawh/Stack (char(10))
    language rpgle parameter style general
    no sql
    external name 'WESD/CALLSTACK(GETPRG)'


and I'm trying to call it from SQl Proc:

 Create Procedure DataWH/Testing () LANGUAGE SQL
   MODIFIES SQL DATA
 Begin
   declare Test char(10);
   set Test = 'Test';
   call stack(Test);
   insert into datawh/Testing values (Test);
 End


but I get an error in the subroutie in the RPGLE when it's trying to 
return
the value:


 D GetPrg          PR            10
.
.
 P GetPrg          B                   Export
 D                 PI            10
.
.
C                   return    PgmName

The error is:

Message ID . . . . . . :   MCH3601       Severity . . . . . . . :   40
Message type . . . . . :   Escape
Date sent  . . . . . . :   05/12/16      Time sent  . . . . . . : 14:29:31

Message . . . . :   Pointer not set for location referenced.
Cause . . . . . :   A pointer was used, either directly or as a basing
  pointer, that has not been set to an address.

Could you please point me in the right direction how I could retrunt he
value please?

Thanks,

Wes
PS. I'm new the RPGLE and trying to get my head around it...







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.