subroutine is called again.

The

procedure

will loop

unless

you cod

tine

to

avoid

this problem.

 

 

 

 

To see

how

to

code an error

subroutine

to avoid

such

a loop, s

Loop

in

an

Error Subroutine”

on

page 235.

 

 

 

Using a File Error (INFSR) Subroutine

To handle a file error or exception in a main procedure you can wr (INFSR) subroutine. When a file exception occurs:

1. The INFDS is updated.

2. A file error subroutine (INFSR) receives control if the exception

¹ On an implicit (primary or secondary) file operation

¹On an explicit file operation that does not have an indicator

positions 73 - 74.

A file error subroutine can handle errors in more than one file.

The

following restrictions

apply:

 

 

 

 

¹

If

a file

exception

occurs

during the

start or

end of a progr

 

an implicit open at the start

of

the cycle) control passes to th

 

exception handler, and not to

the

error

subroutine

handler. Conseque

 

file

error

subroutine

will not

be

processed.

 

¹If an error occurs that is not related to the operation (for index error on a CHAIN operation), then any INFSR error subroutine

ignored. The error would be treated like any other program error

¹ An INFSR cannot handle errors in a file used by a subprocedure.

To add a file error subroutine to your program, you do the followi

1.Enter the name of the subroutine after the keyword INFSR on a Description specification. The subroutine name can be *PSSR, which i

that the program error subroutine is given control for the except

2.Optionally identify the file information data structure on a File ification using the keyword INFDS.

3. Enter

a

BEGSR

operation where

the

Factor 1 entry contains the sa

tine

name

that

is specified

for

the keyword INFSR.

4.Identify a return point, if any, and code it on the ENDSR oper routine. For a discussion of the valid entries for Factor 2, see

Return Point in the ENDSR Operation” on page 237.

5. Code

the

rest of

the

file

error subroutine.

While

any

of

the

operations

can

be used in the file error subroutine, it

is

not

you

use

I/O

operations to

the same

file that got

the

error. Th

tion

must

be

the

last

specification

for the

file error

subroutine

Figure 111 on page 230 shows an example of exception handling using a error subroutine. The program TRNSUPDT is a simple inventory update pro uses a transaction file TRANSACT to update a master inventory file PRDMA I/O error occurs, then the INFSR error subroutine is called. If it error, then the record is written to a backlog file. Otherwise, an issued.

Chapter 12. Handling Exceptions229

Page 253
Image 253
IBM AS/400 manual Using a File Error Infsr Subroutine

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.