|
Mike, You have QAHSTDS and, implicitly, its basing pointer pQHASTDS defined outside the procedure, so they are global. Inside the procedure you have defined the pointer pQAHST00. This is the pointer that you fill with the address of the parameter, but that does nothing for your global pointer pQHASTDS. So when you try to use fields from QAHSTDS, the basing pointer is not set and you get a pointer error. When you change the name of the local variable pQHAST00 to pQHASTDS, you still have a problem. By defining a local variable pQHASTDS, you hide the global variable with the same name. So the pointer of the data structure is still not set. Remove the local definition of pQHASTDS and you should be fine. Joep Beckeringh -----Oorspronkelijk bericht----- Van: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com] Namens Smith, Mike Verzonden: woensdag 27 maart 2002 19:49 Aan: 'rpg400-l@midrange.com' Onderwerp: RE: data structre as parm Well I'm going to open this back up, because I'm still lost. I have the procedure compiled. Blows up on the run telling me ' Pointer not set for location referenced' So my calling program looks like this Callp gemail(QAHSTDS) looks good here. Procedure here. D QAHSTDS e ds ExtName(QAHST00) Based(pQAHSTDS) * __________________________________________________ P GEMAIL B EXPORT D GEMAIL PI D QAHSTDSp LIKE(QAHSTDS) D pQAHST00 s * Inz D EMAIL S 1 c Eval pQAHST00 = %Addr(QAHSTDSP) C/EXEC SQL C+ SELECT QPEMAIL INTO :EMAIL FROM QACTL00 WHERE QPCODE = C+ :QHCODE C/END-EXEC Blows when executing the SQL. QPEMAIL is a field from the data structure QAHSTDS. QAHST00 is an externally described file.
As an Amazon Associate we earn from qualifying purchases.
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.