Previous Topic: Matching Single-Occurrence FilesNext Topic: Matching Multiple Transactions with a Single-Entry Master


Demonstration

Objective

This report contains account information from both a master file and a matching transaction file. Each file has a match key occurrence.

Procedure

The contents of the input buffer, represented by account number, show how the files are matched:

Master file

Transaction file

(SYS010)

(SYS011)

15060

15060

21056

21056

29557

29557

30115

30115

33470

33470

69876

69876

99083

99083

Complete Code

 col. 2
 ▼
 IN  80  F 320 PS(TAPE) MK=M-ACCOUNT           $Master file
 REC FILE-STATUS   0    1   1                   $Input file status
 REC M-ACCOUNT         1    5           'ACCOUNT'
 REC M-NAME            6   20           'NAME'
 REC M-ADDRESS        26   37           '            ADDRESS'
 REC M-ZIP            63    5

 IN 80  F 320 PS(TAPE) MK=T-ACCOUNT            $Transaction file
 REC T-ACCOUNT         1    5           'ACCOUNT'
 REC T-PAYMENT         6    8   2  DP=2 'PAYMENT'
 REC T-DATE           14    6   2       'DATE'
 02OUT D
 023 JANUARY PAYMENTS RECEIVED
 0251*010 M-ACCOUNT               HR
 0251*020 M-NAME                  HR
 0251*030 M-ADDRESS               HR
 0251*035 M-ZIP
 0251*040 T-PAYMENT   SZ=10       HR
 0251*050 T-DATE  FD              HR
 027010   IF FILE-STATUS EQ 1  DROP                $EOF test

Result

REPORT NO. 02 JANUARY PAYMENTS RECEIVED mm/dd/yy PAGE 1 ACCOUNT NAME ADDRESS PAYMENT DATE 15060 SHARON ARMSTRONG 25 CEDAR STREET WAYLAND MA 02756 100.99 mm/dd/yy 21056 AMOS JOHNSON 22651 MASS AVENUE SAN FRANCISCO CA 09801 1,000.00 mm/dd/yy 29557 IRWIN TRIMBLE 102 COLBOURNE ST BROOKLINE MA 09743 50.00 mm/dd/yy 30115 IRMA DOONES 5656 SANDHILL ROAD OCEAN CITY CA 09743 1,009.90 mm/dd/yy 33470 VICTORIA DAY 1234 OAK HILL ROAD EVERGREEN MI 07895 759.00 mm/dd/yy 69876 BRUCE THORPE 11002 PEACHTREE LA ATLANTA GA 76543 900.99 mm/dd/yy 99083 HELEN SANTOVEC 3 APPLE ORCHARD CHARLOTTE NC 64321 5.00 mm/dd/yy

Note: The report would show actual dates in the format shown.