Anyway, take a look at the above links, and if you need anything more than what has been discussed already, please let us know.
You said that the input files are of different LRECL, but you never mentioned what LRECL they are. Kindly provide full information.
In the JCLs provided in the above links, all you need to do is to convert both input files to SAME LRECL. For example, you have two files of LRECL 120 and 200, then convert the file with smaller LRECL (120) to LRECL 200 as shown below.
Code:
OUTREC FIELDS=(1,120, * COPY THE INPUT DATA IN 1 THRU 120 COLS *
200:X) * PAD SPACES AT THE END TILL COL 200 *
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Mon Dec 27, 2004 10:27 am Post subject:
Rama,
Below is a DFSORT/ICETOOL job that will do what you want. I assumed the following:
* Input file1 has RECFM=FB and LRECL=120 and input file2 has RECFM=FB and LRECL=200
* The "key" for matching is in positions 1-9.
* You do not have any duplicates within input file1 or within input file2.
If any of these assumptions are incorrect, the job would have to be changed appropriately.
Code:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/120)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=... input file2 (FB/200)
// DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//OUT DD DSN=... output file (FB/200)
//TOOLIN DD *
* IN1->T1: Pad IN1 records out to 200 bytes to match IN2 records.
COPY FROM(IN1) TO(T1) USING(CTL1)
* IN2/T1->OUT: Select the first dup from IN2 for records in
* IN2 and IN1 that match. Keep only the first 9 matching records.
SELECT FROM(CON) TO(OUT) ON(1,9,CH) FIRSTDUP USING(CTL2)
/*
//CTL1CNTL DD *
OUTREC FIELDS=(1,120,200:X)
/*
//CTL2CNTL DD *
OUTFIL FNAMES=OUT,ENDREC=9
/*
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Hi Rama, I think you cannot concatenate the different LRECL file in SORT(If the file is FB). Phantom suggest the best way to perform this operation. _________________ Regards
Hari
You don't have to worry. The output will be in SORTED order. SELECT command will sort the records in Ascending order of 1,9 as specified in the 'ON(1,9,CH)' parameter.
If you want to sort multiple fields you can repeat the ON parameter as shown below.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Dec 30, 2004 11:22 am Post subject:
Quote:
Hi Frank,
your assumption are correct .But I have one doubt .Will the records what I get will be in sorted order? I want my records to be in sorted order.
Yes, as Phantom indicated, the SELECT operator of DFSORT's ICETOOL will sort the records ascending on the ON field(s).
If you're not familiar with DFSORT or DFSORT's ICETOOL, I'd suggest going through "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 at:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum