View previous topic :: View next topic |
Author |
Message |
haritha_e Beginner
Joined: 30 Jan 2007 Posts: 14 Topics: 8
|
Posted: Tue May 29, 2007 4:43 am Post subject: Easytrieve Match |
|
|
Hi,
I have 3 files.
File 1- Unique on Claim numbers
File 2- Contains some dates for a particular claim number with date code
File 3- Contains some dates for a particular claim number with event code
I want to match the three files based on claim number and write into different output files after updating the transaction date from the file 1. Pls find the input and output data below. Could any body help me out with this
Input File 1
------ Code: |
Clm No Trn Date
C111 01/03/2007
C112 01/04/2007
|
Input File 2
------ Code: |
Clm No Trn Date Date Code
C111 01/01/2007 CSAC
C111 01/01/2007 CSAV
C112 01/02/2007 NGBR
C112 01/02/2007 CALL
|
Input File 3
------ Code: |
Clm No Trn Date Event Code
C111 01/01/2007 CCUS
C111 01/01/2007 CGAR
C111 01/01/2007 CBKR
C112 01/02/2007 CFIN
C112 01/02/2007 CCUS
C112 01/02/2007 CBKR
|
Output File 1
-------------- Code: |
Clm No Trn Date Date Code
C111 01/03/2007 CSAC
C111 01/03/2007 CSAV
C112 01/04/2007 NGBR
C112 01/04/2007 CALL
|
Output File 2
-------------- Code: |
Clm No Trn Date Event Code
C111 01/03/2007 CCUS
C111 01/03/2007 CGAR
C111 01/03/2007 CBKR
C112 01/04/2007 CFIN
C112 01/04/2007 CCUS
C112 01/04/2007 CBKR |
|
|
Back to top |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Tue May 29, 2007 4:54 am Post subject: |
|
|
Both the EZT reference and application guides contain examples of "syncronized" file processing, have you looked there? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue May 29, 2007 8:31 am Post subject: |
|
|
haritha_e,
This is your 2nd question on Easytrieve match logic and you never seem to refer manuals. If I give you the code you will just come back with another question on the same match logic but I don't see where you are trying to learn. This is one of the simplest exercise. Show us what you tried till now and we will guide you
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
haritha_e Beginner
Joined: 30 Jan 2007 Posts: 14 Topics: 8
|
Posted: Tue May 29, 2007 9:12 am Post subject: |
|
|
Hi Kolusu,
I tried using the match command, in the both the output files, i am getting 6 records each.
Can you please let me know where i am making mistake. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue May 29, 2007 9:20 am Post subject: |
|
|
haritha_e,
Your intention is to get match records from file 1 & 2 and file 1 & file 3. do them seperately.
Code: |
//INFILE1 DD *
C111 01/03/2007
C112 01/04/2007
//INFILE2 DD *
C111 01/01/2007 CSAC
C111 01/01/2007 CSAV
C112 01/02/2007 NGBR
C112 01/02/2007 CALL
//INFILE3 DD *
C111 01/01/2007 CCUS
C111 01/01/2007 CGAR
C111 01/01/2007 CBKR
C112 01/02/2007 CFIN
C112 01/02/2007 CCUS
C112 01/02/2007 CBKR
//OUTPUT1 DD SYSOUT=*,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//*
//OUTPUT2 DD SYSOUT=*,
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)
//*
//SYSIN DD *
FILE INFILE1
IN1-REC 01 20 A
CLM-NO1 01 04 A
FILE INFILE2
CLM-NO2 01 04 A
DATE-CODE 21 04 A
FILE INFILE3
CLM-NO3 01 04 A
EVNT-CODE 21 04 A
FILE OUTPUT1 FB(0 0)
OUT1-REC 01 20 A
OUT1-CODE 21 04 A
FILE OUTPUT2 FB(0 0)
OUT2-REC 01 20 A
OUT2-CODE 21 04 A
********************************************
* MAINLINE *
********************************************
JOB INPUT (INFILE1 KEY (CLM-NO1) +
INFILE2 KEY (CLM-NO2))
IF MATCHED
OUT1-REC = IN1-REC
OUT1-CODE = DATE-CODE
PUT OUTPUT1
END-IF
JOB INPUT (INFILE1 KEY (CLM-NO1) +
INFILE3 KEY (CLM-NO3))
IF MATCHED
OUT2-REC = IN1-REC
OUT2-CODE = EVNT-CODE
PUT OUTPUT2
END-IF
/* |
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
haritha_e Beginner
Joined: 30 Jan 2007 Posts: 14 Topics: 8
|
Posted: Tue May 29, 2007 11:14 am Post subject: |
|
|
Kolusu,
Thanks. I tried in the same way earlier, but thought may be we can do it at one shot. |
|
Back to top |
|
 |
|
|