I just don't see why I'd want to change from using multiple parameters to using a data structure. Ranks up there with replacing my externally defined files with internally defined ones with large unused spaces at the end "for growth".
When I use multiple parameters I can:
- Check for validation using many of the keywords like CONST.
- Get better clarity by using many of the keywords like CONST.
- Make it easier to execute from a custom command.
- Instead of having to refer to some definition specs to see what might be in this like
I can use
screenPrice=currentprice(iprod, qtyordered, custnbr);
and I don't have to remember to zero out some data structure field to use the same one as
- Make it easier to convert a subprocedure with a return value into a sql UDF so I can do something like
SELECT IPROD, CURRENTPRICE(IPROD, QTYORDERED, CUSTNBR) FROM ORDLINE
That last reason is one huge reason that I would like to convince some developers here to stop making little programs all over the place but instead use a service program and subprocedures. If they insist on using it "the old fashion way" then they could make a simple old program that accept parameters then uses the subprocedure out of the service program. And, yes the service program should come first instead of having the subprocedure in the service program call the old program. Why should the new way take the performance hit of calling an OPM program?