I need to create a new member for an existing physical file in my RPG-program. I know of two ways, and I must say, that I like neither:
- use
QCMDEXC
to make a call toADDPFM
- write an CL-program, that calls
ADDPFM
and call that from RPG
The first one involves cat'ing together a command that has to be parsed by QCMDEXC
which does not sound to performant (I know, the expansive part here is not the call, but the creation of the member) -- but what bothers me really about it, is that I don't find it straightforward, but on the contrary hard to follow and not very aesthetic.
The second one uses a compiled program, so there is no concating and parsing involved. Also, it does not look that horrible in your RPG-code, because it is only one normal procedure call. But I'll have to create an extra external program, that need's to be transfered to all systems my RPG-program will be used on. It also kind of conflicts with my sense of aesthetics, creating an extra source and binary just to do one api call.
Is there a way to call the api directly, without QCMDEXC
? Or maybe another RPGish way of creating a new member to a PF? Google was no help to me at all..
Thanks