Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Musab Razeen Ahmed,
You could use a DFSORT JOINKEYS job like this:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input fileA
//IN2 DD DSN=... input fileB
//SORTOUT DD DSN=... output file
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,1,A),SORTED
JOINKEYS F2=IN2,FIELDS=(1,1,A),SORTED
REFORMAT FIELDS=(F1:1,80)
OPTION COPY
/*
|
Alternatively, assuming there are no duplicates within each file and they have the same RECFM and LRECL, you could use the SELECT operator of DFSORT's ICETOOL like this:
Code: |
//S2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//CON DD DSN=... input fileA
// DD DSN=... input fileB
//OUT DD DSN=... output file
//TOOLIN DD *
SELECT FROM(CON) TO(OUT) ON(1,1,CH) FIRSTDUP
/*
|
In either case, the output file would have:
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, along with all of the other DFSORT books, from:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|