KOLDARK,
I agree that there are special situations that require unique approaches. That's why I was asking WHY they needed to clear the workfile within the RPG program. Generally, you want to use the "usually accepted" methods of programming in order to make the programs easier to maintain. If this simply a workfile that needs to be cleared before updating, then it should be handled in a CL program because other programmers maintaining the software will expect to see it there. If some logic is required before the decision to clear the file is made, then it is a different situation.
Executing an AS/400 command directly from an RPG program, especially a CLRPFM command, without a MONMSG to handle error conditions (empty file, file in use, etc.) is asking for problems.
Don't misunderstand, I'm not trying to start a debate on "best practices". I feel the the "right way" is something that works efficiently and perhaps just as important - easy to maintain. There is no ONE correct way to do most programming tasks. I am just giving my opinion as a consultant who has to maintain programs written using many different techniques. If you use an unusual technique, then it can take more time to understand the process.
K.Hood