Resolving Conversion Problems

Merging an Array with an Externally Described DS Subfield

As mentioned earlier, you are not allowed to define a standalone array structure subfield with the same name in RPG IV. In general, the Conv will merge these two definitions. However, if the subfield is in an e described data structure, this merging is not handled and you will be manually correct the converted source member.

For example, the field ARRAY in Figure 206

is

included

twice in

Figure 2

included once as a standalone array and once in the externally

descri

structure

EXTREC.

When converted,

the

RPG

IV

source

generated

is show

Figure 208.

This code will not compile

since ARRAY is defined twice. I

correct this problem, delete the standalone array and add a

subfield

keywords

to data

structure DSONE

as

shown

in

Figure 209.

 

AR RECORD

A

 

 

 

CHARACTER

10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

A

 

 

 

ARRAY

 

10

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure

206.

DDS for external data structure

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

E

 

 

 

 

ARRAY

10

1

 

 

 

 

 

 

 

 

 

 

 

 

 

IDSONE

 

E DSEXTREC

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

CHAR

DSPLY

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

SETON

 

 

 

 

LR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure

207. RPG III source using external data structure with array

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

D ARRAY

 

S

 

 

1

DIM(10)

 

 

 

 

 

 

 

 

 

 

 

D DSONE

 

E DS

 

 

 

EXTNAME(EXTREC)

 

 

 

 

 

 

 

 

C

CHAR

 

 

DSPLY

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

SETON

 

 

 

 

 

 

 

 

LR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure

208. RPG IV source with two definitions for the array

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

D DSONE

 

E DS

 

 

 

EXTNAME(EXTREC)

 

 

 

 

 

 

 

 

D

ARRAY

 

E

 

 

 

DIM(10)

 

 

 

 

 

 

 

 

 

 

 

C

CHAR

 

 

DSPLY

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

C

 

 

 

 

SETON

 

 

 

 

 

 

 

 

LR

 

 

 

 

 

 

 

 

 

 

 

 

Figure

209. Corrected RPG IV source with a single definition for the array

 

 

 

Renaming

and

Initializing

an

Externally

Described

DS

Subfield

 

 

 

 

 

 

 

In RPG III, when both renaming

and

initializing a

field

in

an

externa

data

structure, you had to use two source

lines, as

shown

for the

 

Figure 210

on

page 403.

The

converted

source

also

contains

two

source

l

shown

in Figure 211

on

page 403.

This

use

of

two

source

lines

for a

 

result

in a compile-time error,

as the

field

CHAR

is defined

twice.

T

code

you

must

combine

the

keywords

of

the

field

CHAR

into

a

single

l

in Figure 212

 

on page 403,

where

the

key

fields

INZ and EXTFLD have b

bined

and

only

one

instance

on

the

field

CHAR

is

shown.

 

 

 

 

 

 

402 ILE RPG for AS/400 Programmer's Guide

Page 426
Image 426
IBM AS/400 manual Merging an Array with an Externally Described DS Subfield, Initializing, Extrec, When converted

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.