Consider using STG(*DEFINED) fields instead of *BASED for this type of
logic. No need to do pointer math that way, and aside from the pointer
stuff, they work the same as *BASED. Save *BASED for times when you
need to be able to change the address in memory where the variables point.
As for Joel's initial question, a *MSGF/RTVMSG might be an easier
solution. But, ultimately, the problem is that CL just isn't that good
at string manipulation. Using a better language like RPG or REXX would
almost certainly work better. Why force a square peg through a round hole?
On 5/14/2012 9:49 AM, DrFranken wrote:
I'm going to guess no, but in some cases you might be able to simplify
by declaring&P_CLIENT,&P_SEQ etc as *BASED fields of a longer
character variable thus building the VALUES( clause there. It could
look as simple as VALUES(&VALUES) avoiding all those *cats in your program.