IBM Power Systems

IBM Power Systems

About This Blog

Warm wishes and welcome to all AS400 Administrators and Operators.



This is exclusive blog for iSeries system Administrators working anywhere in the world. Also a place for guys and gals who want to share knowledge pertaining to iSeries. This blog has been designed for exchanging knowledge on AS400 or iSeries server administration and operations.



Wednesday, July 21, 2010

Few programming related queries resolution...

1. How can we add another module in running rpgle pgm
Sol: In debug mode, we can press F14 "Work with Module List" to add modules to running RPGLE Program.

2. How to handle MSGW in a program?
Sol: First question here is why program is going in Message wait? Definitely, due to some error, where the program is looking for a response like ('C', 'I', 'D') etc. Thus the root cause here is runtime errors occuring in the program, which can be avoided using appropriate error handling mechanism, like MONITOR.

3. How to retrieve the duplicate records
Sol: Not sure whether the context of question is CL or RPG or SQLRPG program. But in RPG, READE opcode can be well used. In SQLLE, we can use SELECT with WHERE clause and use cusors to read the same, and finally, if req. in CL, we can use OPNQRYF with selection creteria.

4. How to enter the values at runtime without using parm keyword in cl program.
Sol: It can easile be performed while executing the program in debug mode. There, we can set the values of any variable.

Comments are invited..

2 comments:

  1. Hi Sanjeev
    Here are the solutions to the queries you asked. Although, as the questions are not fully descriptive so solutions may vary depending upon the way the questions are understood by the reviewer.
    Regards

    ReplyDelete
  2. 2. How to handle MSGW in a program?

    Message waits are also used by server jobs waiting for work. I use message queues, the send message API and the receive message API to wake up the server job. The MSGW is a 'normal' status for these jobs.

    ReplyDelete