IBM AS/400 Frozen Dessert Maker User Manual


 
Methods for Processing Disk Files
C 01 Z-ADD 0 TOTHRS 5 1
C 01 Z-ADD 0 TOTOVT 5 1
C 01 SETOFF 12
C*
C MR IF (*IN02='1')
C ADD EHWRK TOTHRS
C EHWRK SUB ENHRS OVTHRS 4 111
C 11 ADD OVTHRS TOTOVT
C SETON 12
C ENDIF
OPRINT H 1P 2 6
O 50 'YTD PAYROLL SUMMARY'
O D01 1
O 12 'EMPLOYEE: '
O ENAME 32
O D01 1
O 12 'SERIAL #: '
O ENUM 17
O 27 'DEPT: '
O EDEPT 30
O 40 'TYPE: '
O ETYPE 41
O D02MR 1
O 8 'WEEK #'
O WEEKNO 10
O 32 'HOURS WORKED = '
O EHWRK 3 38
* These 2 detail output lines are processed if *IN01 is on
* and no matching records found (that means no RCWEEK records
* for that employee found). Obviously, the total fields
* (TOTHRS and TOTOVT) are equal to zeros in this case.
O D 01NMR 1
O 70 'YTD HOURS WORKED = '
O TOTHRS 3 78
O D 01NMR 1
O 70 'YTD OVERTIME HOURS = '
O TOTHRS 3 78
* These 2 total output lines are processed before performing
* detail calcualations. Therefore, the total fields
* (TOTHRS and TOTOVT) for the employee in the last retrieved
* record will be printed out if the specified indicators are on.
O T0112 1
O OR LR 12
O 70 'YTD HOURS WORKED = '
O TOTHRS 3 78
O T0112 1
O OR LR 12
O 70 'YTD OVERTIME HOURS = '
O TOTOVT 3 78
Figure 149 (Part 2 of 2). Sequential-by-Key Processing, Example 3
298 ILE RPG for AS/400 Programmer's Guide