× 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.



hey all,

i've got an OPM style program (in RPGIV) that I call from a bunch of
different places, a bunch of times - an obvious candidate for a service
program procedure - but i'm having a brain lock trying to convert it to
one.  my experience with SPs is limited to modifying stuff I download from
here and other web sources

it currently does the following:

1. loads a file into an array at *inzsr. (this is done, because I must
reformat the data a little to be useful - can't do a chain/setll/etc at
runtime)  the file is very static, and is only loaded into the array one
time per job.  subsequent calls to the program, the data is already loaded.

2. based on parameters passed, does a bunch of things, changes parameters
passed and returns.

3. if called with a end-of-job marker set, it turns on *inlr and exits (so
that the program is purged from the job)

my questions are:

where do you specify files in a service program?  just under the H specs
like an OPM program?  What if this file is only needed in one of the
service program procedures?  is there a way to make the file local to that
procedure only?

can service program procedures have subroutines? or do you have to create
sub-procedures?  if both, recommendations?  if just sub-procedures, are
variables defined at the main procedure level global to the sub-procedure
(like a subroutine) or do I have to define them up with the files to make
them global?

do you see what I'm getting at?  it's a reasonably large program (500
lines) and uses subroutines liberally, and i'd like to convert it as
painlessly as possible.  But if I have to and/or should re-write it to make
it a better candidate for a SP procedure, I will.

thanks,

rick



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.