IBM AS/400 manual Sequential-within-Limits Processing, Methods for Processing Disk Files

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 326
Image 326
2 (Sequential-within-Limits Processing):

Methods for Processing Disk Files

*****************************************************************

*

PROGRAM NAME:

ESWLIM1

 

*

* RELATED FILES:

EMPMST

(Physical File)

*

*

 

LIMITS

(Physical File)

*

*

 

PRINT

(Printer File)

*

*

DESCRIPTION:

This program shows the processing of an

*

*

 

indexed file sequentially within limits.

*

*

 

This program prints out information for the

*

*

 

employees whose employee numbers are within

*

*

 

the limits given in the file LIMITS.

*

*****************************************************************

FLIMITS

IR

F

6

3 DISK

RAFDATA(EMPMST)

FEMPMST

IP

F

28L

3PIDISK

KEYLOC(1)

FPRINT

O

F

80

PRINTER

 

*Input specifications must be used to describe the records￿ in the

*program-described file EMPMST.

IEMPMST

NS 01

 

 

 

I

P

1

3

0ENUM

I

 

4

23

ENAME

I

 

24

24

ETYPE

I

P

25

26

0EDEPT

*As EMPMST is processed within each set of limits, the corre￿s-

*ponding records are printed. Processing of the EMPMST file is

*complete when the record-address file LIMITS reaches end ￿of file.

OPRINT

H

1P

 

1

 

O

 

 

 

12

'SERIAL #'

O

 

 

 

22

'NAME'

O

 

 

 

45

'DEPT'

O

 

 

 

56

'TYPE'

O

D

01

 

1

 

O

 

 

ENUM

10

 

O

 

 

ENAME

35

 

O

 

 

EDEPT

45

 

O

 

 

ETYPE

55

 

Figure 152. Sequential-within-Limits Processing of an Externally Described File

EXAMPLE PROGRAM

2 (Sequential-within-Limits Processing):

Figure 153

shows the data description specifications (DDS)

for the record-address

used by the program ESWLIM2 ( Figure 154 on page 303).

 

 

A*****************************************************************

A* RELATED PROGRAMS:

ESWLIM

*

 

A*

DESCRIPTION:

This is the DDS for the physical file

*

 

A*

 

LIMITS.

*

 

A*

 

It contains a record format named LIMIT. *

A*****************************************************************

A

 

 

 

 

AR LIMIT

 

 

A

LOW

5

0

 

 

 

 

 

 

 

A

HIGH

5

0

 

 

 

 

 

 

 

 

 

 

Figure

153.

DDS for record address file LIMITS (physical file)

 

This

 

program

performs

the

same

job

as the

previous program.

The only d

is

that the physical

file EMPMST

is

defined

as an externally

described

of

a

program-described file.

 

 

 

 

 

302 ILE RPG for AS/400 Programmer's Guide

Page 326
Image 326
IBM AS/400 manual Sequential-within-Limits Processing, Methods for Processing Disk Files