|
On Apr 12, 2023, at 8:04 AM, Jay Vaughn <jeffersonvaughn@xxxxxxxxx> wrote:
lol oh wow, I figured it out...
And I presume if you don't write in COBOL every single day, you aren't
going to know this...
Probably why Jon and Richard could not spot the issue in my code I provided.
So if I move my Linkage Section (3 lines) to the bottom of the DATA
DIVISION, no pointer error.
Even works fine in my original *SRVPGM/*MODULE implementation.
mystery solved.
thanks!
Jay
On Wed, Apr 12, 2023 at 7:58 AM Jay Vaughn <jeffersonvaughn@xxxxxxxxx>
wrote:
ok, so I've simplified this a great deal and still getting the pointer--
error...
Below is simply a SQLCBLLE *PGM, and no pointer error on the EXEC SQL in
the procedure division.
But as soon as I uncomment out the Linkage Section 3 lines, I get the
pointer error on the EXEC SQL in the procedure division.
Why is this?
PROCESS NOMONOPRC.
IDENTIFICATION DIVISION.
PROGRAM-ID. CBL00001P.
**************************************************************
**************************************************************
ENVIRONMENT DIVISION.
**************************************************************
CONFIGURATION SECTION.
SPECIAL-NAMES.
**************************************************************
**************************************************************
DATA DIVISION.
**************************************************************
WORKING-STORAGE SECTION.
77 WS-MESSAGE PIC X(50).
*LINKAGE SECTION.
*01 INCOMING-VALUE1 PIC X(5).
*01 OUTGOING-VALUE1 PIC X(50).
exec sql
set option
commit = *NONE,
closqlcsr = *ENDMOD,
datfmt = *ISO
end-exec.
exec sql
include sqlca
end-exec.
**************************************************************
PROCEDURE DIVISION.
**************************************************************
PAR1.
exec sql
select "SQL row count from CBL00001P SQL: " concat
char(count(*))
into :WS-MESSAGE
from coreirst.rst00001t
end-exec.
END PROGRAM CBL00001P.
On Tue, Apr 11, 2023 at 12:15 PM Jon Paris <jon.paris@xxxxxxxxxxxxxx>
wrote:
I have no idea what you are doing wrong Jay - but using Richard's code as
a base I was able to create a service program and call it multiple times
from an RPG test program with zero failures.
I ran the SrvPgm as *Caller and allowed the RPH to default the AG.
Everything worked as it should.
You need to show us the CRT commands for the SP and the RPG caller. What
AGs are being used? How does the COBOL return - Exit Program or ... ?
Jon P
On Apr 11, 2023, at 7:59 AM, Jay Vaughn <jeffersonvaughn@xxxxxxxxx>wrote:
richard@xxxxxxxxxxxxxxxxx>
Tried the changes...
still the pointer error when the SQLCBLLE is a *module in a *srvpgm, and
called from an SQLRPGLE.
Jay
On Mon, Apr 10, 2023 at 8:15 PM Jay Vaughn <jeffersonvaughn@xxxxxxxxx>
wrote:
Awesome.
Thanks.
I’ll try these changes out.
Jay
On Apr 10, 2023, at 7:11 PM, Richard Schoen <
justwrote:
statement of the sqlcblle.
Looks like you also don't need the comma in this statement:
PROCEDURE DIVISION USING INCOMING-VALUE1, OUTGOING-VALUE1.
I changed it to:
PROCEDURE DIVISION USING INCOMING-VALUE1,
OUTGOING-VALUE1.
Didn't know that would solve it but it seemed to.
Also looks like this becomes your subproc ID for service program:
PROGRAM-ID. CBL00000M_PGM1.
Proc is: CBL00000M_PGM1
Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx
-----Original Message-----
Thanks Richard,
So my parameters error (pointer) error was occurring on the exec sql
Funny thing, if you were in debug, and viewed the :outgoing-value1
But asbefore the exec sql statement it was initialized and referenceable.
standsoon as you stepped on the exec sql you would get the pointer error.
Also my sqlclble was a *module accessed from a srvpgm, not just a
(COBOL400-L) mailing listalone *pgm.--
--(COBOL400-L) mailing list
This is the COBOL Programming on the IBM i (AS/400 and iSeries)
To post a message email: COBOL400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/cobol400-l.
This is the COBOL Programming on the IBM i (AS/400 and iSeries)
To post a message email: COBOL400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/cobol400-l.
--
This is the COBOL Programming on the IBM i (AS/400 and iSeries)
(COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/cobol400-l.
This is the COBOL Programming on the IBM i (AS/400 and iSeries) (COBOL400-L) mailing list
To post a message email: COBOL400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/cobol400-l
or email: COBOL400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/cobol400-l.
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.