I need some help please. I am a beginner with Easytrieve and I think my problem is mostly because I don't quite understand it yet, but any help and patience will greatly be appreciated.
Let me explain what I am trying to do.
I have 2 files both sorted via Reference number and Document Sequence. So 1 reference number can contain multiple Sequence numbers, and thus some reference numbers are duplicated in both files.
1st file (FILEA) has 252,226 records
2nd file (FILEB) has 17,942 records
The 2nd file is an extract I ran on our database and from the 252,226 records 17,942 records has to be updated.
The 2nd file contains values I want to update the 1st file with. Example...the records in FILEA that has no Client Code I want to update with the value in FILEB.
So in short when I Match the files and create the Output dataset, I want to be able to use this dataset to upload the data, but the totals must be the same as FileA 252,226.
But with my JCL I have am 10,093 records more? What could cause this?
i split the Matched and unmatched into different datasets in the hope that it might work, but to no avail. My Easytrieve looks as follows:
/=/=/=/=/=/=/=/=/=/==/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=//=/=/=/==/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=
//*
//**********************************************************************
//STP01#01 EXEC PGM=EZTPA00
//**********************************************************************
//*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSNAP DD SYSOUT=*
//*
//FILEA DD DSN=SDIB.ABRN170.PAD.X28GADB.UAT.UNLOAD.SRT,DISP=SHR
//FILEB DD DSN=SDIB.ABRN170.PAD.GADB.UAT.CLNTCODE.UPDATE,DISP=SHR
//FILEC DD DSN=SDIB.ABRN170.PAD.X28GADB.UAT.MATCH,
// DISP=(MOD,CATLG),
// SPACE=(TRK,(50,50),RLSE),
// RECFM=FB,LRECL=409
//*
//FILED DD DSN=SDIB.ABRN170.PAD.X28GADB.UAT.NOMATCH,
// DISP=(MOD,CATLG),
// SPACE=(TRK,(50,50),RLSE),
// RECFM=FB,LRECL=409
//*
//SYSIN DD *
*
FILE FILEA FB(409 27812)
IRECA 001 409 A
A-REF_NO 001 005 P
A-DOC_SEQ 006 002 P
A-CLIENT_CODE 008 010 A
A-DATE 339 026 A
*
FILE FILEB FB(17 32759)
B-REF_NO 001 005 P
B-DOC_SEQ 006 002 P
B-CLIENT_CODE 008 010 A
*
FILE FILEC FB(409 27812)
ORECC 001 409 A
C-REF_NO 001 005 P
C-DOC_SEQ 006 002 P
C-CLIENT_CODE 008 010 A
*
FILE FILED FB(409 27812)
ORECD 001 409 A
D-REF_NO 001 005 P
D-DOC_SEQ 006 002 P
D-CLIENT_CODE 008 010 A
*
JOB INPUT (FILEA KEY(A-REF_NO) +
FILEB KEY(B-REF_NO))
*
IF MATCHED
ORECC = IRECA
C-CLIENT_CODE = B-CLIENT_CODE
PUT FILEC
GOTO JOB
END-IF
*
IF NOT MATCHED
ORECD = IRECA
PUT FILED
GOTO JOB
END-IF
/=/=/=/=/=/=/=/=/=/==/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=//=/=/=/==/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=
//*
//**********************************************************************
//STP01#01 EXEC PGM=EZTPA00
//**********************************************************************
//*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSNAP DD SYSOUT=*
//*
//FILEA DD DSN=SDIB.ABRN170.PAD.X28GADB.UAT.UNLOAD.SRT,DISP=SHR
//FILEB DD DSN=SDIB.ABRN170.PAD.GADB.UAT.CLNTCODE.UPDATE,DISP=SHR
//FILEC DD DSN=SDIB.ABRN170.PAD.X28GADB.UAT.MATCH,
// DISP=(MOD,CATLG),
// SPACE=(TRK,(50,50),RLSE),
// RECFM=FB,LRECL=409
//*
//FILED DD DSN=SDIB.ABRN170.PAD.X28GADB.UAT.NOMATCH,
// DISP=(MOD,CATLG),
// SPACE=(TRK,(50,50),RLSE),
// RECFM=FB,LRECL=409
//*
//SYSIN DD *
*
FILE FILEA FB(409 27812)
IRECA 001 409 A
A-REF_NO 001 005 P
A-DOC_SEQ 006 002 P
A-CLIENT_CODE 008 010 A
A-DATE 339 026 A
*
FILE FILEB FB(17 32759)
B-REF_NO 001 005 P
B-DOC_SEQ 006 002 P
B-CLIENT_CODE 008 010 A
*
FILE FILEC FB(409 27812)
ORECC 001 409 A
C-REF_NO 001 005 P
C-DOC_SEQ 006 002 P
C-CLIENT_CODE 008 010 A
*
FILE FILED FB(409 27812)
ORECD 001 409 A
D-REF_NO 001 005 P
D-DOC_SEQ 006 002 P
D-CLIENT_CODE 008 010 A
*
JOB INPUT (FILEA KEY(A-REF_NO) +
FILEB KEY(B-REF_NO))
*
IF MATCHED
ORECC = IRECA
C-CLIENT_CODE = B-CLIENT_CODE
PUT FILEC
GOTO JOB
END-IF
*
IF NOT MATCHED
ORECD = IRECA
PUT FILED
GOTO JOB
END-IF
/=/=/=/=/=/=/=/=/=/==/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=//=/=/=/==/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=/=
Any help or suggestions will be greatly appreciated.