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



Richard,

In my case the first reason I used a subprocedure instead was to force
myself to make subprocedures the habit and subroutines the exception.
Otherwise it was just easy to fall back to what was easier and more
comfortable.
The second reason was to see if it could be pushed along the evolutionary
path.

Ok, using your global variable example. BPCS does not have an on-hand
field. To calculate on-hand you have to use
onhand = OpeningBalance + Receipts + Adjustments - Issues
And, unless you also subprocedure your file i/o these are usually global
variables.
So you're thinking why make these a subprocedure vs a subroutine? Follow
along...

Let's say you make this a subprocedure so you can then do
currentOnHand = onhand(OpeningBalance, Receipts, Adjustments, Issues)
Ok, not very clear why this would be anymore productive? I totally agree.
However follow along...

So now you move this subprocedure out into a service program.
So now you create a function
Create Function OnHand as...
And your function calls your external RPG subprocedure export from your
service program.
Still not intuitively obvious as to why this is more productive? I can
understand. Follow along...

Now you create a view
Create View IimView as (
select colA, colB, ...,
onhand(OpeningBalance, Receipts, Adjustments, Issues) as OnHandBalance
from iim...

Now your users can use their favorite query tool to query the data and no
longer have to calculate the onhand (and risk getting it wrong) on each
and every query they write. They query the IimView instead of the IIM
file directly. And if you choose to use the view to pretty up the
columns, like change the names from IMOPB, IMREC, IMADJ, IMISS, IMBS :-)
to more meaningful names, convert the 8,0 date formats into real dates,
etc you can.
Now, does that make some sense? You really have to look long term.




Rob Berendt

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