Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling Service Programs from ILE Cobol

447 views
Skip to first unread message

John Part

unread,
Nov 28, 2000, 8:15:09 PM11/28/00
to
Hi,

Hopefully some one can help me, I have written two Cobol programs, one
is a function, which I made into a Service progam, and the second I
made a program.

I created modules for both programs, the function I then used the
CRTSRVPGM, and the main progam I used CRTPGM, and entered the Service
program in as a bound service program. When I run the main progam, it
runs fine until it calls the function.

I have tried CALL pgm, CALL LINKAGE TYPE IS PROGRAM pgm, but I keep
getting an error telling me that my main program can't find or resolve
to the function.

Can someone please help me, should I be using something other than
CALL? or is there a special version of the call command?

I have also tried creating a single program, binding in both modules
but still got the same error.

The same question would apply to a CL program, is there a special way
of calling ILE functions?

Any help would be greatly appreciated.

Thanks,

JP
6 Woodstown Heights,
Knocklyon, Dublin 16
Ireland.
Mobile = 087-6777208

sarva...@my-deja.com

unread,
Nov 29, 2000, 3:00:00 AM11/29/00
to
Hi John,

I don't know about ILE COBOL, but in CL you call a procedure in a
SRVPGM by the CALLPRC command. Also, to do that, you need to Bind the
SRVPGM (Dynamic Binding) to the calling PGM.

Hope it helps

Sarva


Sent via Deja.com http://www.deja.com/
Before you buy.

Rolf Mittag

unread,
Nov 29, 2000, 3:00:00 AM11/29/00
to
Mind looking into the manual?

http://publib.boulder.ibm.com/pubs/html/as400/online/v4r4eng.htm

HTH

--

Dipl.Inf.(FH) Rolf P Mittag
IBM Partner In Development
Leipziger Str. 50
D-69214 Eppelheim
eMl: r...@r-m-e-d-v.de
Fon: +49 (6221) 76 78 60
Fax: +49 (6221) 76 80 26

Karl Hanson

unread,
Nov 29, 2000, 3:00:00 AM11/29/00
to
John Part wrote:
>
> Hopefully some one can help me, I have written two Cobol programs, one
> is a function, which I made into a Service progam, and the second I
> made a program.
>
> I created modules for both programs, the function I then used the
> CRTSRVPGM, and the main progam I used CRTPGM, and entered the Service
> program in as a bound service program. When I run the main progam, it
> runs fine until it calls the function.
>
> I have tried CALL pgm, CALL LINKAGE TYPE IS PROGRAM pgm, but I keep
> getting an error telling me that my main program can't find or resolve
> to the function.
>
> Can someone please help me, should I be using something other than
> CALL? or is there a special version of the call command?
>
> I have also tried creating a single program, binding in both modules
> but still got the same error.
>
> The same question would apply to a CL program, is there a special way
> of calling ILE functions?
>

One thing to check is if the expected entry point is exported from the
service program.. this is controlled by the EXPORT parameter of
CRTSRVPGM. To see which (if any) function entry points are exported, do
DSPSRVPGM SRVPGM() DETAIL(*PROCEXP). For details see the binder
language section of Chapt 4 in the ILE Concepts manual:
http://publib.boulder.ibm.com:80/cgi-bin/bookmgr/DOCNUM/SC41-5606-04

--

Karl Hanson

Rick Price

unread,
Nov 30, 2000, 3:00:00 AM11/30/00
to
I think it should be LINKAGE TYPE IS PROCEDURE.

There is an alternative way which I used. I set up a copybook with the
first line:
LINKAGE TYPE IS PROCEDURE routine1 routine2....
where routine 1 etc are names of service program entries which all programs
could need.

I include this in the SPECIAL-NAMES paragraph of all COBOL programs.

Then the service program entries can just be called as a normal CALL.

Rick

John Part <j...@iol.ie> wrote in message news:3a24554...@news.iol.ie...

0 new messages