*-----------------------------------------------------------------

*Define the cancel handler. The parameter is a pointer to the

*'communication area', a message to be displayed.

 

*-----------------------------------------------------------------

 

 

P CanHdlr

B

 

 

D CanHdlr

PI

 

 

D

pMsg

 

*

 

 

*-----------------------------------------------------------------

 

 

 

* Define a field based on the input pointer pMsg.

 

*-----------------------------------------------------------------

 

 

D Msg

S

20A

BASED(pMsg)

 

*-----------------------------------------------------------------

 

 

*Display the message set by the procedure that enabled the￿

*handler.

 

*-----------------------------------------------------------------

 

 

C

'Cancel Hdlr 'DSPLY

Msg

P CanHdlr

E

 

 

 

 

 

 

 

Figure

118 (Part

4 of 4).

Enabling and Coding a Cancel Handler for a Subprocedure

The following is the output from program CANHDLR. Note that the *PSSR of procedure SubProc is called three times but the cancel handler is o because it was disabled before the third error.

DSPLY

Cancel Hdlr

Divide by zero

DSPLY

Subproc PSSR

 

DSPLY

Cancel Hdlr

String error

DSPLY

Subproc PSSR

 

DSPLY

Subproc PSSR

 

 

 

Figure

119. Output from CANHDLR program

Problems when ILE CL Monitors for Notify and Status Messages

If your ILE RPG procedure is called by an ILE CL procedure in th group, and the caller is monitoring for status or notify messages, th caller may get control prematurely because of a notify or status me ILE RPG procedure was trying to ignore.

For example, if the ILE RPG procedure writes a record to a printe actual printer file has a shorter record length that was declared dure, notify message CPF4906 is sent to the RPG procedure. The RPG e handling percolates this message which causes the default reply of message. This should allow the output operation to continue normally, an procedure should proceed to the next instruction.

However,

when the

ILE

CL

MONMSG

gets

control,

control passes

immediately

the

action

for

the MONMSG or the next statement

in

the

ILE

CL

proced

Note:

For

this

problem

 

to

occur,

the

procedure

monitoring

 

for

the

mes

 

not

have

to

be

the

immediate

caller

 

of

the

RPG

procedure.

This

problem

is

most

likely

to

occur

with

a

MONMSG

in

an

ILE

CL

caller,

also occur with other ILE languages

that

can

monitor

for

notify

and

sages, including

ILE

RPG using

ILE

condition

 

handlers

enabled

using

CEEHD

 

 

 

 

 

 

 

 

 

 

 

Chapter

12.

Handling

Exceptions247

 

 

 

Page 271
Image 271
IBM AS/400 manual Likely Occur With, RPG using, Condition Handlers Enabled Using, Cancel Hdlr Dsply Msg CanHdlr

AS/400 specifications

The IBM AS/400, now known as the IBM iSeries, is a midrange computer system that has been a cornerstone of enterprise computing since its introduction in 1988. Designed to provide a robust platform for business applications, the AS/400 is celebrated for its reliability, scalability, and integrated database capabilities.

One of the key features of the AS/400 is its Integrated Operating Environment, which blends hardware and software resources seamlessly. This integration allows businesses to execute diverse workloads, ranging from traditional applications to modern web-based services, all on a single platform. The operating system, OS/400 (now IBM i), offers a rich set of APIs and tools for developers, simplifying application development and management.

Another standout characteristic of the AS/400 is its built-in database, DB2 for i. This powerful relational database management system allows for efficient data handling and provides advanced features such as support for SQL, XML, and JSON, making it easier for businesses to manage their data and integrate it with other systems. The database's tight integration with the operating system enables high performance and security.

In terms of scalability, the AS/400 can accommodate small businesses as well as large enterprises, with the ability to support hundreds of users simultaneously. Its architecture allows for easy upgrades in hardware, meaning that organizations can scale their systems without replacing the entire infrastructure.

Security is another critical attribute of the AS/400. With a sophisticated security model, it offers built-in user authentication, access control, encryption, and auditing capabilities to protect data and applications from unauthorized access.

The AS/400 also supports multiple programming languages, including RPG, COBOL, Java, and PHP, giving organizations the flexibility to choose the development tools that best fit their needs. This diversity helps maintain legacy applications while also developing new ones that leverage modern technologies.

Moreover, the platform supports both traditional green-screen interfaces and modern graphical user interfaces, allowing organizations to transition smoothly into contemporary user experience paradigms.

Overall, the IBM AS/400 stands out as a resilient, flexible, and secure computing platform that enables organizations to effectively manage their business operations, streamline processes, and adapt to changing market demands. Its unique combination of integrated features and capabilities ensures that it remains relevant in today's fast-paced technology landscape.