sudib19
New User
Joined: 06 Feb 2007 Posts: 29 Location: Noida
|
|
|
|
Hi,
I have two fixed block files of length 492. I want to match the two files, if from the positions 142 of length 51 position 322 of length 66 and position 452 of lenght 1 match then replace from the first file to the second the 37th position record of length 10.
I want to have the same number of records in the output file as of the second file, just that the 37th position onwards till 10 bytes it is replaced from the first record.
I had coded it as follows but am not getting my numbers right. Can someone please let me know where I am going wrong?
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=XX.XX#123.file1,DISP=SHR
//IN2 DD DSN=XX.XX#123.file2,DISP=SHR
//MATCH DD DSN=XX.XX#123.JOIN1,
// UNIT=(SYSDA,6),
// SPACE=(CYL,(50,50),RLSE),
// DCB=(RECFM=FB,LRECL=492,BLKSIZE=0),
// DISP=(NEW,CATLG,DELETE)
//* DISP=(OLD)
//ELNMTCH DD DSN=XX.XX#123.JOIN2,
// UNIT=(SYSDA,6),
// SPACE=(CYL,(50,50),RLSE),
// DCB=(RECFM=FB,LRECL=492,BLKSIZE=0),
// DISP=(NEW,CATLG,DELETE)
//GASNMCH DD DSN=XX.XX#123.JOIN3,
// UNIT=(SYSDA,6),
// SPACE=(CYL,(50,50),RLSE),
// DCB=(RECFM=FB,LRECL=492,BLKSIZE=0),
// DISP=(NEW,CATLG,DELETE)
//SYSIN DD *
OPTION COPY
JOINKEYS F1=IN1,FIELDS=(142,51,A,322,66,A,452,1,A)
JOINKEYS F2=IN2,FIELDS=(142,51,A,322,66,A,452,1,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:01,492,F2:01,492,?,F2:01,36,F1:37,10,F2:47,446)
OUTFIL FNAMES=MATCH,INCLUDE=(985,1,CH,EQ,C'B'),BUILD=(986,492)
OUTFIL FNAMES=ELNMTCH,INCLUDE=(985,1,CH,EQ,C'2'),BUILD=(493,492)
OUTFIL FNAMES=GASNMCH,INCLUDE=(985,1,CH,EQ,C'1'),BUILD=(1,492)
/* |
In the next step I am using ICETOOL to get the duplicates out of ELNMTCH and then combining with MATCH file. I was expecting the count to match exactly with that of the IN2 file, but unfortunately it does not.
Please help.
Thanks
Sudip |
|