I'm trying to relate with something you may (or may not) know better.
Have you done any RPG programming? If so, have you ever used a subprocedure? Not a subroutine, a subprocedure. If you have, have you ever called a RPG subprocedure which returned a value, for example:
SpecialPricing = RetrievePricing(CustomerNumber : ItemNumber : QuantityOrdered);
In which RetrievePricing is a subprocedure in your RPG. This subprocedure has three input variables and returns one variable, the pricing.
CALLPRC is CL's way of calling a subprocedure.
Now, let's expand this. Instead of CRTCLPGM let's say you run CRTCLMOD. This creates a *MODULE object instead of a *PGM object. Then let's say instead of CRTBNDRPG you run CRTRPGMOD. This creates a *MODULE object instead of a *PGM object. Now you can bind them together into one program with CRTPGM and specify both modules. Binding is the reason you see BND in the middle of CRTBNDRPG. It automatically takes the module into a program and discards the module.
There's a book about this called ILE Concepts. Now, this is probably heresy but I don't believe I've ever cracked the cover on it.
There's a lot of cool stuff you can do with this, like service programs, creating your own SQL functions out of your existing subprocedures, etc. Wouldn't it be cool to be able to do
Select CustomerNumber, ItemNumber, QuantityOrdered, ItemDescription,
RetrievePricing(Customer Number, ItemNumber, QuantityOrdered), ItemDesc, ...
From mytable
?
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.