IBM AS/400 manual Methods for Processing Disk Files, DDS for database file EMPMST physical file

Models: AS/400

1 489
Download 489 pages 47.95 Kb
Page 318
Image 318
Figure 144. DDS for database file EMPMST (physical file)

Methods for Processing Disk Files

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

A* DESCRIPTION: This

is the

DDS

for the physical file EMPMST.

*

A*

It

contains

one

record

format

called EMPREC.

*

A*

This

file contains one

record

for each employee *

A*

of

the company.

 

 

 

*

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

A*

AR EMPREC

A

ENUM

5

0

TEXT('EMPLOYEE NUMBER')

A

ENAME

20

 

TEXT('EMPLOYEE NAME')

A

ETYPE

1

 

TEXT('EMPLOYEE TYPE')

A

EDEPT

3

0

TEXT('EMPLOYEE

DEPARTMENT')

A

ENHRS

3

1

TEXT('EMPLOYEE

NORMAL WEEK HOURS')

AK ENUM

Figure 144. DDS for database file EMPMST (physical file)

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

A* DESCRIPTION:

This is the

DDS

for the physical file TRWEEK.

*

A*

It contains

one

record

format

called RCWEEK.

*

A*

This file contains

all

weekly

entries made to

*

A*

the time reporting

system.

 

*

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

A*

AR RCWEEK

A

ENUM

5

0

TEXT('EMPLOYEE

NUMBER')

A

WEEKNO

2

0

TEXT('WEEK NUMBER OF

CURRENT YEAR')

A

EHWRK

4

1

TEXT('EMPLOYEE

HOURS

WORKED')

AK ENUM

AK WEEKNO

Figure

145. DDS for database file TRWEEK (physical file)

 

 

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

A* RELATED FILES:

EMPMST

(Physical

File)

*

A*

 

TRWEEK

(Physical

File)

*

A*

DESCRIPTION:

This is the DDS for

the logical file EMPL1.

*

A*

 

It contains two record formats called

*

A*

 

EMPREC and RCWEEK.

 

*

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

A

R EMPREC

 

 

PFILE(EMPMST)

 

AK ENUM

A*

A

R RCWEEK

PFILE(TRWEEK)

AK ENUM

AK WEEKNO

Figure

146. DDS for database file EMPL1 (logical file)

 

EXAMPLE PROGRAM 1 (Sequential-by-Key Using Primary File):

 

In this

example, the employee master record

(EMPREC)

and the weekly hours worked

record

(RCWEEK) are contained in the

same

logical file EMPL1. The EMPL1 f

defined as a primary input file and is read sequentially by key. In

description specifications

for the file, the key

for

the EMPREC record

the ENUM (employee number)

field, and the key for

the

RCWEEK record i

294 ILE RPG for AS/400 Programmer's Guide

Page 318
Image 318
IBM AS/400 manual Methods for Processing Disk Files, DDS for database file EMPMST physical file