× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You don't have to use a service program. You can compile it as a module. To include it in a program you have two options: add it to a binding directory and use CRTBNDRPG (this is the easy way), or use CRTPGM and list the module on the command, but if you do things this way, you have to compile all of your source to modules first, and then create the program using CRTPGM. For procedures that I define in a source outside the main program source, I always build them into service programs though. That way the source is only in one program, the service program. If something changes I don't have to remember all the places it is included. Even if you compile it into a service program you don't have to use a binding directory. Life is just easier with the binding directory. I have a CL that builds all of my service programs. When I add a new service program, I update that program to support creation of the new service program. Likewise when I add a new module to a service program. Less for me to remember. I use binding directories, but since I build my service programs using a CLP, It isn't really necessary. You could just have a single binding directory that simply contains all your service programs, and include ctl-opt DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR('WHATEVER'); in your program header. Compile with CRTBNDRPG. Don't have to remember anything, it is real simple. Use ACTGRP(*CALLER) if the program is intended to be called by another ILE program. Some people use CLP's to initiate everything, in that case all the RPG's are *CALLER, and the CLP's use *NEW. Probably more than you were looking for, but it doesn't seem like you are really doing ILE yet.

Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx


-----Dan <dan27649@xxxxxxxxx> wrote: -----
To: RPG400-L@xxxxxxxxxxxx
From: Dan <dan27649@xxxxxxxxx>
Date: 08/14/2015 12:26PM
Subject: External procedure call returns a value. Does it need to be a service program?

My first time in a *long* time developing a program that returns a value to
the calling program. Not quite connecting the dots.

d WrapText2 PR 12288 EXTPROC('UTPARSER')
d UnfText 8192 Varying Const Options(*VarSize)
d LineLen 5 0 Const
d LineBreak1 10 Varying Const Options(*NoPass)
d LineBreak2 10 Varying Const Options(*NoPass)

(I first tried EXTPGM instead of EXTPROC, but it got flagged with RNF3755
"The EXTPGM keyword is not allowed when a return value is specified.")

Using EXTPROC, there are no errors in the compiler, but the compile/bind
step fails with CPD5D02 "Definition not found for symbol 'UTPARSER'."

Per supervisor, we're trying to avoid having to use a binding directory.

Ideas / advice appreciated.

- Dan

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.