Methods for Processing Disk Files

as the ENUM field plus the WEEKNO (week number) field, which is a co key.

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

*

PROGRAM NAME:

YTDRPT1

 

 

*

* RELATED FILES:

EMPL1

(Logical

File)

*

*

 

PRINT

(Printer

File)

*

*

DESCRIPTION:

This program shows an example of processing

*

*

 

records using the

sequential-by-key method.

*

*

 

This program prints out each employee's

*

*

 

information and weekly hours worked.

*

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

FPRINT

O

F

80

PRINTER

FEMPL1

IP

E

 

K DISK

*A record-identifying indicator is assigned to each record￿; these

*record-identifying indicators are used to control proces￿sing for

*the different record types.

IEMPREC

01

I*

 

IRCWEEK

02

I*

 

*Since the EMPL1 file is read sequentially by key, for

*a valid employee number, the ENUM in a RCWEEK record

*must be the same as the ENUM in the last retrieved EMPREC

*record. This must be checked for and is done here by saving

*ENUMs of the EMPREC record into the field EMPNO and compar￿ing

*it with the ENUMs read from RCWEEK records.

*If the ENUM is a valid one, *IN12 will be seton. *IN12 is

*used to control the printing of the RCWEEK record.

C

 

 

SETOFF

 

 

 

12

C

01

 

MOVE

ENUM

EMPNO

5 0

C*

 

 

 

 

 

 

 

C

 

 

IF

(*IN02='1') AND (ENUM=EMPNO)

 

C

 

 

SETON

 

 

 

12

C

 

 

ENDIF

 

 

 

 

OPRINT

H

1P

2

6

 

 

O

 

 

 

 

40

'EMPLOYEE WEEKLY WORKING '

O

 

 

 

 

52

'HOURS REPORT'

 

O

 

H

01

1

 

 

 

O

 

 

 

 

12

'EMPLOYEE: '

 

O

 

 

ENAME

 

32

 

 

O

 

H

01

1

 

 

 

O

 

 

 

 

12

'SERIAL #: '

 

O

 

 

ENUM

 

17

 

 

O

 

 

 

 

27

'DEPT: '

 

O

 

 

EDEPT

 

30

 

 

O

 

 

 

 

40

'TYPE: '

 

O

 

 

ETYPE

 

41

 

 

O

 

H

01

1

 

 

 

O

 

 

 

 

20

'WEEK #'

 

O

 

 

 

 

50

'HOURS WORKED'

 

O

 

D

12

1

 

 

 

O

 

 

WEEKNO

 

18

 

 

O

 

 

EHWRK

3

45

 

 

 

 

 

 

Figure

147.

Sequential-by-Key Processing, Example 1

 

Chapter 16. Accessing Database 295Files

Page 319
Image 319
IBM AS/400 YTDRPT1 Related Files EMPL1, Fprint, FEMPL1 Disk, Iemprec Ircweek, Setoff Move Enum Empno, Seton Endif Oprint

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.