I've now been successful in implementing your suggestion. Some comments follow.
The following is successful for a static link. Cobol compiler options "NODYNAM
NODLL" and the inclusion of SYS1.SCSFSTUB in the binder SYSLIB.
//CSFLINK JOB NOTIFY=&SYSUID
// JCLLIB ORDER=(IGY.V6R3M0.SIGYPROC)
//COMPILE EXEC PROC=IGYWCL,
// PARM.COBOL='NODYNAM NODLL',
// PARM.LKED='LIST=NOIMP MAP XREF LET=0'
//COBOL.SYSIN DD *
id division.
program-id. rngl.
procedure division.
call 'csnbrngl'
goback.
end program rngl.
//LKED.SYSLIB DD DISP=SHR,DSN=SYS1.SCSFSTUB
Results:
A8 CSFRNGL * CSECT 1D0 SYSLIB 01 CSNBRNGL
0 A8 CSNBRNGL LABEL
Next is a successful "DLL link". Cobol compiler options "NODYNAM DLL". Added
"DYNAM=DLL CASE=MIXED" to the binder parameters. The CSFDLL31 side file is
included "in place" of SCSFSTUB.
//CSFLINK JOB NOTIFY=&SYSUID
// JCLLIB ORDER=(IGY.V6R3M0.SIGYPROC)
//COMPILE EXEC PROC=IGYWCL,
// PARM.COBOL='NODYNAM DLL',
// PARM.LKED='LIST=NOIMP MAP XREF LET=0 DYNAM=DLL CASE=MIXED'
//COBOL.SYSIN DD *
id division.
program-id. rngl.
procedure division.
call 'csnbrngl'
goback.
end program rngl.
//LKED.SYSIN DD DISP=SHR,DSN=SYS1.SIEASID(CSFDLL31)
Results:
-------
SOURCE --------
IMPORT/EXPORT TYPE SYMBOL DLL DDNAME SEQ
MEMBER
------------- ------ ---------------- ---------------- -------- ---
---------
IMPORT CODE CSNBRNGL CSFDLL31 SYSLIN 02
CSFDLL31
Now, if we take the previous example (DLL resolution) and add back SYSLIB with
SYS1.SCSFSTUB, the static resolution takes precedence over DLL resolution,
which is what I don't want.
//CSFLINK JOB NOTIFY=&SYSUID
// JCLLIB ORDER=(IGY.V6R3M0.SIGYPROC)
//COMPILE EXEC PROC=IGYWCL,
// PARM.COBOL='NODYNAM DLL',
// PARM.LKED='LIST=NOIMP MAP XREF LET=0 DYNAM=DLL CASE=MIXED'
//COBOL.SYSIN DD *
id division.
program-id. rngl.
procedure division.
call 'csnbrngl'
goback.
end program rngl.
//LKED.SYSLIB DD DISP=SHR,DSN=SYS1.SCSFSTUB
//LKED.SYSIN DD DISP=SHR,DSN=SYS1.SIEASID(CSFDLL31)
Results:
1A8 CSFRNGL * CSECT 1D0 SYSLIB 01 CSNBRNGL
0 1A8 CSNBRNGL LABEL
-------
SOURCE --------
IMPORT/EXPORT TYPE SYMBOL DLL DDNAME SEQ
MEMBER
------------- ------ ---------------- ---------------- -------- ---
---------
*** NO SYMBOLS IMPORTED ***
Next let's try Barry's suggestion:
//CSFLINK JOB NOTIFY=&SYSUID
// JCLLIB ORDER=(IGY.V6R3M0.SIGYPROC)
//COMPILE EXEC PROC=IGYWCL,
// PARM.COBOL='NODYNAM DLL',
// PARM.LKED='LIST=NOIMP MAP XREF LET=0 DYNAM=DLL CASE=MIXED'
//COBOL.SYSIN DD *
id division.
program-id. rngl.
procedure division.
call 'csnbrngl'
goback.
end program rngl.
//LKED.SYSLIB DD DISP=SHR,DSN=SYS1.SCSFSTUB
//LKED.SYSIN DD *
INCLUDE SIEASID(CSFDLL31)
LIBRARY (CSNBRNGL)
//LKED.SIEASID DD DISP=SHR,DSN=SYS1.SIEASID
Unlike my attempt to do this with our standard compile proc, this does seem to
work as designed.
It does put out the following warning, which causes an RC of 4 instead of 0,
which is annoying.
IEW2455W 9205 SYMBOL CSNBRNGL UNRESOLVED. NOCALL OR NEVERCALL SPECIFIED.
But in the end it succeeds with the DLL import to resolve it.
*** I M P O R T E D A N D E X P O R T E D S Y
M B O L S ***
-------
SOURCE --------
IMPORT/EXPORT TYPE SYMBOL DLL DDNAME SEQ
MEMBER
------------- ------ ---------------- ---------------- -------- ---
---------
IMPORT CODE CSNBRNGL CSFDLL31 SIEASID 01
CSFDLL31
When I modify our standard compile proc in a similar (!!) manner I still get an
error:
IEW2638S 5384 AN EXECUTABLE VERSION OF MODULE *NULL* EXISTS AND CANNOT BE
REPLACED BY THE NON-EXECUTABLE MODULE JUST
CREATED.
I'm unclear as to what I am doing differently here. Not sure if I'll research
it any further, however, as I don't think this is really the solution I'm
looking for. Two reasons:
1) I can't use it for non-DLL applications, and thus it defeats my desire to
have a single proc that works for both DLL and non-DLL applications (without
overrides).
2) That warning message just bugs me!
I am still thinking about making an RFE to give DLL linkage priority. Is this
a lost cause, or should I do it?
Thanks!
Frank
On Wed, 11 Aug 2021 06:44:50 -0500, Barry Lichtenstein <[email protected]>
wrote:
>Hi Frank,
>
>Two things I'd check:
>
>* You've invoked the binder with the DYNAM=DLL parm
>
>* The reference(s) are dynamic (descriptors) so that they can be satisfied by
>the IMPORT
>
>Otherwise the binder cannot resolve them dynamically and since you now told it
>to not autocall...
>
>Barry
>
>On Tue, 10 Aug 2021 16:41:46 -0500 Frank Swarbrick
><[email protected]> wrote:
>>
>> Hi Barry,
>>
>> Interesting. But I can't quite get it to work. What's bizarre is that the
>> DLL linkage seems to get resolved:
>>
>> IMPORT/EXPORT TYPE SYMBOL DLL DDNAME
>> SEQ MEMBER
>> ------------- ------ ---------------- ---------------- --------
>> --- ---------
>> IMPORT CODE CSNBRNGL CSFDLL31 SIEASID
>> 01 CSFDLL31
>>
>> But the binder is still giving me an error:
>>
>> IEW2455W 9205 SYMBOL CSNBRNGL UNRESOLVED. NOCALL OR NEVERCALL SPECIFIED.
>> IEW2638S 5384 AN EXECUTABLE VERSION OF MODULE *NULL* EXISTS AND CANNOT BE
>> REPLACED BY THE NON-EXECUTABLE MODULE JUST
>> CREATED.
>>
>> Very odd!
>>
>> Frank
>
>----------------------------------------------------------------------
>For IBM-MAIN subscribe / signoff / archive access instructions,
>send email to [email protected] with the message: INFO IBM-MAIN
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN