Returning from a Called Program or Procedure

¹The RETURN operation (with a blank factor 2) is processed, the H

indicators are not on, and the LR indicator is on.

¹The RT indicator is on, the H1 through H9 indicators are not on, indicator is on.

When a main procedure ends normally, the following occurs:

¹

The Factor-2-to-Result-field

move

of

a

*ENTRY PARM operation is perfor

¹

All

arrays

and

tables with

a

'To

file

name' specified on the Def

 

tions, and

all locked

data

area

data

structures are written out.

¹

Any

data

areas

locked

by

the

procedure are unlocked.

¹

All

files

that

are

open

are

closed.

 

¹A return code is set to indicate to the caller that the proced

normally, and control then returns to the caller.

On the next call to the

main procedure, with the exception of expo

fresh copy is available for

processing.

(Exported variables

are

init

when the program is first

activated in an activation group. They ret

assigned

value

on

a new call,

even

if LR was on for the previous

c

to re-initialize

them, you

have

to

reset them

manually.)

 

 

 

TIP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If you

are

accustomed

to

ending

with LR on to cause storage

to

and you are running in a

named

(persistent) activation group,

you

ma

consider

returning

without

an

end.

The

reasons

are:

 

 

¹The storage is not freed until the activation group ends so the

storage advantage to ending with LR on.

¹Call performance is improved if the program is not re-initialized call.

You

would only want to do this if you did not need your program

each

time.

Abnormal End

A

main

procedure

ends

abnormally and

control

returns to

the calling

pro

when one of

the

following occurs:

 

 

 

 

¹

The

cancel

option is

taken when an

ILE

RPG inquiry

message is

issu

¹An ENDSR *CANCL operation in a *PSSR or INFSR error subroutine is proc-

essed. (For further information on the *CANCL return point for the * INFSR error subroutines, see “Specifying a Return Point in the ENDSR Operation” on page 237).

¹An H1 through H9 indicator is on when a RETURN operation (with a

factor 2) is processed.

¹ An H1 through H9 indicator is on when last record (LR) processing the RPG cycle.

When a main procedure ends abnormally, the following occurs:

Chapter 10. Calling Programs and Procedures153

Page 177
Image 177
IBM AS/400 manual Abnormal End, Returning from a Called Program or Procedure, Entry Parm operation is perfor

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.