×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




If this piece of logic you put into UTPARSER won't see use outside of the program, I really don't see value in a service program vs a module. I'm not sure I see value in a module either, unless it makes sense to you as far as modularization goes.

Just going to list what I think the options are (including other suggestions):
* Create a service program. Procedure can return a value. The calling program will require a binding directory or something to inform the person/system compiling it that it will use the service program.
* Create a module and bind it into the program. Requires binding directory or something to inform the person/system compiling it that it needs the module.
* Put the procedure from UTPARSER into the main program that will be using it.
* Change UTPARSER to use an "output" parameter instead of a return value.

Without knowing the full story, I can't really recommend an approach, however I will tell you that I pretty much never create a program that provides a 'service' to another program.

Kurt Anderson
Sr. Programmer/Analyst - Application Development, Service Delivery Platform

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Dan
Sent: Friday, August 14, 2015 1:32 PM
To: RPG400-L@xxxxxxxxxxxx
Subject: Re: External procedure call returns a value. Does it need to be a service program?

Just a quick note that I'm trying the suggestions here, although I'm quickly gathering that the service program is the way to go here. I may need to do it the supervisor's way, and then do it with a service program, then show her the two options.

Not sure this utility will see much use outside of the program I am including it in, but it's generic enough, and there are a lot of long strings defined in our database that need to be cut down for printing and EDI, so I can't help but think there's a lot of potential usage.

(Buck, the RNF3755 is a syntax error. EXTPGM keyword and return length on the PR line not allowed.)

I'll report back how this resolves. Thanks for everyone's advice!

- Dan

On Fri, Aug 14, 2015 at 12:19 PM, Dan <dan27649@xxxxxxxxx> wrote:

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

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2026 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.