Manta alt

YOUR IBM i TRAINING SOURCE

You must allow the browser to execute JavaScript programs if you want to view product information. If your browser is set up to execute JavaScript programs, the problem is that the product ID was incorrect. Use the menu bar above to find the desired product.

Overview

Audio

This course describes how to send and receive messages and how to detect and handle errors in a CL program.

The course begins by describing message processing concepts. It then shows how to write a program that uses messages to communicate with a workstation user or another program. You will see how to send a message to a workstation user, how to send a message to another program or procedure, and how to receive a message. The course then shows how to monitor messages in a program and how to handle the exception and error conditions those messages represent.

Approximate Study Time: 90 minutes

Objectives

After completing this course, you should be able to:

  • Describe the difference between an impromptu and a predefined message
  • Describe the format of a message identifier
  • Identify and describe the different types of messages that a CL program can send and receive
  • Identify and describe the different types of message queues to which a CL program can send messages and from which a CL program can receive messages
  • Use the SNDUSRMSG command in a CL program to send an informational message to a workstation user
  • Use the SNDUSRMSG command in a CL program to send an inquiry message to a workstation user and receive its reply
  • Use the SNDPGMMSG command in a CL program to send a message to another program or procedure
  • Use the RCVMSG command in a CL program to receive a message
  • Use the MONMSG command in a CL program to monitor for messages

Topic Outline

Message Concepts

Sending Messages

Receiving Messages

Monitoring Messages

Audience

This course is intended for anyone who will be writing CL programs. This audience consists primarily of application programmers, but may include other people who use CL commands, such as system operators.

Prerequisites

This course assumes that you have a working knowledge of basic IBM i concepts and facilities. You can satisfy this prerequisite by successfully completing the courses in the following series:

The course also assumes you familiar with IBM i programming concepts and facilities. You can satisfy this prerequisite by successfully completing the courses in the following series:

The course also assumes that you have a basic understanding of CL programming concepts, know how to declare and use variables in a CL program, and know how to control the flow of execution in a CL program. You can satisfy these prerequisites by successfully completing the first two courses in this series: