Category: <span>FAQs and Tips</span>

Q. In your December 2004 article, “10 Cool Things About RPG IV,” I could not get the %XLATE(‘$*,’:’ ‘:Amount) line to work. Testing the %XLATE with constant fields and stepping through it, I found the $ would be replaced by a space, but the asterisk and comma were left in. The only way it would work was to do three %Xlate functions – removing only one of the characters at a time. Did I do something wrong?

Q. I’m having problems using /Copy in a free format RPG block. The compiler error I get is:

RNF0257
Form-Type entry not valid
or out of sequence.

What am I doing wrong?

Q. You’ve recommended placing prototype (PR) definitions in copybook(s), then using /COPY to copy the prototypes into the modules that need them. At our company, some programmers place not only the prototypes in copybooks but also the procedure interface (PI) definitions too. Could there ever be a good reason to do this?

Q. I read your tip about using CALLP with a variable program name. I want to do something similar, but with procedures. I want a program to choose one from among several different possible procedures to run, depending upon the contents of a database field. Is there a way to do this with CALLP?