|
On Apr 11, 2023, at 12:37 PM, Jay Vaughn <jeffersonvaughn@xxxxxxxxx> wrote:
I have 2 cobol pgms in my *MODULE... have tried it with just one though,
same issue.
Ending with END PROGRAM pgmName.
complete module source... (just ran this and got the error)...
*//////////////////////////////////////////////////////////////
* COBOL EXPORTABLE PROGRAM 1
*//////////////////////////////////////////////////////////////
PROCESS OPTIONS.
PROCESS NOMONOPRC.
IDENTIFICATION DIVISION.
PROGRAM-ID. CBL00000M.
**************************************************************
**************************************************************
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 USING INCOMING-VALUE1
OUTGOING-VALUE1.
**************************************************************
exec sql
select "SQL row count from CBL00000M SQL: " concat
char(count(*))
into :WS-MESSAGE
from lib.file
end-exec.
move ws-message to outgoing-value1.
* MOVE "SUCCESSFUL CALL TO CBL00000S/CBL00000m COBOL Proc"
* TO OUTGOING-VALUE1.
END PROGRAM CBL00000M.
*//////////////////////////////////////////////////////////////
* COBOL EXPORTABLE PROGRAM 2
*//////////////////////////////////////////////////////////////
PROCESS NOMONOPRC.
IDENTIFICATION DIVISION.
PROGRAM-ID. CBL00001M.
**************************************************************
**************************************************************
ENVIRONMENT DIVISION.
**************************************************************
CONFIGURATION SECTION.
SPECIAL-NAMES.
**************************************************************
DATA DIVISION.
**************************************************************
WORKING-STORAGE SECTION.
01 WS-WINDOWMESSAGE PIC X(10000).
01 WS-RETURNACTION PIC X(6).
LINKAGE SECTION.
01 INCOMING-VALUE1 PIC X(5).
01 OUTGOING-VALUE1 PIC X(50).
**************************************************************
PROCEDURE DIVISION USING INCOMING-VALUE1, OUTGOING-VALUE1.
**************************************************************
MOVE "SUCCESSFUL CALL TO CBL00000S/CBL00001m COBOL Proc"
TO OUTGOING-VALUE1.
END PROGRAM CBL00001M.
Module creation...
CRTSQLCBLI OBJ(JVAUGHN/CBL00000M) over my source.
srvpgm creation...
CRTSRVPGM SRVPGM(JVAUGHN/CBL00000S)
MODULE(JVAUGHN/CBL00000M JVAUGHN/CBL00001M)
EXPORT(*SRCFILE)
SRCFILE(JVAUGHN/COBOL)
SRCMBR(CBL00000B)
ACTGRP(*CALLER)
My sqlrpgle *PGM...
ctl-opt debug option(*nodebugio)
dftactgrp(*no) actgrp('CBL')
bnddir('CBL');
dcl-s g_pgm1Rtn char(50) inz;
dcl-pr cbl00000m extproc('CBL00000M');
i_parm1 char(5) const;
o_parm1 char(50);
end-pr;
cbl00000m('test1'
:g_pgm1Rtn);
The call stack at run time and when I get the pointer error...
------Activation Group------ Control
Program Name Number Boundary
QCMD QSYS *DFTACTGRP 0000000000000001 Yes
QUICMENU QSYS *DFTACTGRP 0000000000000001 No
QUIMNDRV QSYS *DFTACTGRP 0000000000000001 No
QUIMGFLW QSYS *DFTACTGRP 0000000000000001 No
QUICMD QSYS *DFTACTGRP 0000000000000001 No
QUOCPP QPDA *DFTACTGRP 0000000000000001 No
QUOMAIN QPDA *DFTACTGRP 0000000000000001 No
QUOCMD QSYS *DFTACTGRP 0000000000000001 No
CBLTEST JVAUGHN CBL 0000000000000034 Yes
CBLTEST JVAUGHN CBL 0000000000000034 No
CBL00000S JVAUGHN CBL 0000000000000034 No
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:
as
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 <richard@xxxxxxxxxxxxxxxxx
wrote:
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 justbefore the exec sql statement it was initialized and referenceable. But
(COBOL400-L) mailing listsoon as you stepped on the exec sql you would get the pointer error.--
alone *pgm.
Also my sqlclble was a *module accessed from a srvpgm, not just a stand
--(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.