On 3/18/2011 3:46 PM, Phil Smith wrote:
Well, adding ALIASES(ALL) seems to be the answer.
Now to solve the original problem, which is much nastier
(involving long, mixed-case names...)

Thanks.
--
...phsiii

Phil Smith III
[email protected]
Voltage Security, Inc.
www.voltage.com
(703) 476-4511 (home office)
(703) 568-6662 (cell)


Well, Phil, you got me intrigued, since I haven't looked
at these issues for a while. I did some experiments and
some reading and confirmed what the Enterprise COBOL
Programming Guide says:

"You cannot make dynamic calls to:
  + COBOL DLL programs
  + COBOL programs compiled with the PGMNAME(LONGMIXED)
    option, unless the program-name is less than or equal
    to eight characters in length and is all uppercase
..."


there's more, but these seem to cover the case you
were trying to solve. If you want to dynamically
call alternate entry points with long and / or
mixed case names you will have to go the DLL route.


So, it's either static linkages or DLL linkages to
use invoke entry points with long / mixed case names.
Furthermore, you can't use alternate entry points for
DLL linkages.


So, if you're not afraid to use DLL linkages, here's
a simple example that might help:

1. Subroutine; source member name CBSUBLN2:
   this has an entry point (program-id) that is mixed
   case and longer than 8 characters:


 process rent pgmname(longmixed) dll exportall
*  Copyright (C) 2011 by Steven H. Comstock
 Identification division.
 program-id.  'ComeAndGetIt'.

 environment division.
 data division.
 linkage section.
 01  innum       pic s9(9)   binary.
*
 procedure division using innum.
 thecode.
     display 'Entered ComeAndGetIt'
     compute innum = innum * 2
     goback.


2. The calling program, COBOLCL:

 process pgmname(longmixed) dll
 identification division.
 program-id. 'COBOLCL'.
 environment division.
 data division.
 working-storage section.
 01  ws-first1 pic s9(9) usage is binary value 3.
 01  sub-name  pic x(12) value 'ComeAndGetIt'.
 procedure division.
     display 'In COBOLCL'
     call 'ComeAndGetIt' using ws-first1
     display 'Return value = ' ws-first1
     goback.


Compile the subroutine and bind it with options
DYNAM(DLL),RENT,AMODE(31),RMODE(ANY),CASE(MIXED)
and provide a DD named SYSDEFSD in the bind
step (this can be a PDS or PDSE or even a
sequential file; use LRECL 80, choose your
blocksize)

Compile the main program and bind it with options
RENT,DYNAM(DLL),AMODE=31,RMODE=ANY,CASE(MIXED)
and in the bind step include
//stepname.SYSDEFSD DD DISP=SHR,DSN=your_sysdefsd
//stepname.SYSIN  DD  *
  INCLUDE SYSDEFSD(CBSUBLN2)

When you run the main program, you will see:

In COBOLCL
Entered ComeAndGetIt
Return value = 000000006

================================================

Well, it's been real. I appreciate your raising the issues
because it gave me a chance to go back and review and
relearn things I haven't worked with for a while.

==================================================



--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-393-8716
http://www.trainersfriend.com

* To get a good Return on your Investment, first make an investment!
  + Training your people is an excellent investment

* Try our new tool for calculating your Return On Investment
    for training dollars at
  http://www.trainersfriend.com/ROI/roi.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to