I have an SQLCBLLE *MODULE that contains embedded sql.
This *MODULE is part of a *SRVPGM.
If I call this SQLCBLLE *MODULE from an SQLRPGLE pgm, I get a pointer error on the exec sql that does a select into :WS-MESSAGE. However, if I make the SQLCBLLE *MODULE a *PGM, the embedded sql works fine with no pointer error.
Here is the *MODULE source... (the commented out EXEC SQL is where the pointer error occurs in debug... though the funny thing is in debug if you eval :WS-MESSAGE it is initialized and referenceable as if it is a legit ready to go host variable so not sure exactly what this pointer error is referring to...?)
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 coreirst.rst00001t
* end-exec.
* move ws-message to outgoing-value1.
MOVE "SUCCESSFUL CALL TO CBL00000S/CBL00000m COBOL Proc"
END PROGRAM CBL00000M.
I tried call the *MODULE as a *PGM and that worked.