Q: I keep noticing that in many CL programs, I see SNDPGMMSG MSGID(CPF9898)...and then the message goes on to be unique by having different stuff in the MSGDTA parm. I think I've missed something along the way. What's so special about using CPF9898?
A: What is so special about CPF9898 is that it's a general-purpose message description that has no constant portions except a period at the end. Instead of being something like:
File &1 in &2 not found.
...(where you can replace only &1 and &2 for the name of a file and its library, but the rest of the message remains constant), CPF9898 is just this:
&1.
When you feed the text you want to display through MSGDTA, it is displayed with a period at the end. If you don't want the period, use CPF9897 instead.
In real-life applications, you should always create your own message descriptions instead of using CPF9898. By creating them, you can include many things that CPF9898 cannot accommodate, such as numeric variables. Besides, the MSGDTA parameter won't have to include the entire text of the message.
LATEST COMMENTS
MC Press Online