The respective record which matches the key field
from input-1 to Input-2 and Input-3 should be in output file.
Input-1
--------
E1 first file record
E3 first file record
E4 first file record
E6 first file record
Input-2
-------
E1 second file record
E2 second file record
E3 second file record
E3 second file record DUp
Input-3
-------
E3 third file record
E4 third file record
E5 third file record
Ouput
-----
T1 E1 first file record
T2 E1 second file record
T1 E3 first file record
T2 E3 second file record
T2 E3 second file record Dup
T3 E3 third file record
T1 E4 first file record
T3 E4 third file record
T1 E6 first file record
First file record should be prefix with 'T1' in the output
Second file record should be prefix with 'T2' in the output
third file record should be prefix with 'T3' in the output
My record length is 150
Recfm is FB
"E2 second file record "
is not in the output file
coz no respective key field in Input-1
"E5 third file record"
is not in the output file
coz no respective key field in Input-1
The key 'E3' matches in all the file
so respective records are concatinated according to that..
The key 'E6' not matches in second and third output
file
so E6 first file record is in the output file without respective record from other file
Do 1 thing first compare file 1 and file2 then u will get 1 matching file...after tht compare tht matching file with the 3 rd file then u will get desired output......
Code:
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//*FIRST FILE
//IN1 DD DSNAME= 1st fil name, DISP=SHR
//*SECOND FILE
//IN2 DD DSNAME=2nd fil name,DISP=SHR
//T1 DD DSN=&T1,SPACE=(CYL,(5,5),RLSE),DISP=(MOD,PASS)
//T2 DD DSN=&T2,SPACE=(CYL,(5,5),RLSE),DISP=(MOD,PASS)
//CONCT DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,DELETE)
// DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,DELETE)
//* THIS FILE WILL HAVE THE MATCHING RECORDS WHICH EXIST
//* IN BOTH THE FILES
//OUT12 DD DSNAME=give some file name,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(10,5),RLSE),
// DCB=*.IN1
//* DCB=(RECFM=FB,LRECL=17,BLKSIZE=1700)
//* THIS FILE WILL HAVE THE RECORDS FROM FIRST FILE
//* WITH NO MATCHING FOUND
//OUT1 DD DSNAME=for un matching recds give 1 file name,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(10,5),RLSE),
// DCB=*.IN1
//* DCB=(RECFM=FB,LRECL=17,BLKSIZE=1700)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T2) USING(CTL2)
SPLICE FROM(CONCT) TO(OUT12) ON(1,08,CH) WITH(10,1) -
USING(CTL3) KEEPNODUPS //this will ntg but removes duplicates
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1:1,08,9:C'11') //here give sort key fields
//CTL2CNTL DD *
OUTREC FIELDS=(1:12,08,9:C'22') //here give sort key
//*MATCHING CRITERION SHOULD BE SPECIFIED HERE
//CTL3CNTL DD * //here give sort key
OUTFIL FNAMES=OUT12,INCLUDE=(9,2,CH,EQ,C'12'),OUTREC=(1,08)
OUTFIL FNAMES=OUT1,INCLUDE=(9,2,CH,EQ,C'11'),OUTREC=(1,08)
/*
Next time you need help, please spend some more time figuring out exactly what you need before you post the first time. That will save us all a lot of time.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
All of the DFSORT and ICETOOL statements and parameters are discussed in detail in "z/OS DFSORT Application Programming Guide" which you can access online along with all of the other DFSORT books from:
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online from the link given above.
Quote:
First four byte what it will do?
What is RDW?
RDW is "record descriptor word". The first two bytes of the four-byte RDW contains the length of the record in binary. You should really read up on this stuff.