mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Dear Experts,
I have 2 Input files. They look as follows:
Code: |
Input file 1: LRECL = 18
|< col1 >||< col2 >|
9-char 9-char
AFF68KAA250178466M
A00780BA289700900T
A2486HIU682011727M
A2486HIV482013632M
A88997CB454124797M
B96996CG470076682M |
Input file2: LRECL = 16
Code: |
|<col1 >||<col2>|
12 char 3 char
AFF68KAA2001|456
AFF68KAA2011|376
AHF68KAA2002|232
B96996CG4023|786
A88997CB4342|795
A2486HIU6876|234 |
So, I want to generate the output files for every < col1> of input file1 exists in first 9-char of <col1> in input file2, then copy that record into output file.
Output File: LRECL = 16
Code: |
AFF68KAA2001|456
AFF68KAA2011|376
B96996CG4023|786
A88997CB4342|795
A2486HIU6876|234
|
Pls help me in wrting the DFSORT Card. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you have the Nov, 2009 DFSORT PTF, you can use the following DFSORT JOINKEYS job to do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/18)
//IN2 DD DSN=... input file2 (FB/16)
//SORTOUT DD DSN=... output file (FB/16)
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(1,9,A)
JOINKEYS F2=IN2,FIELDS=(1,9,A)
REFORMAT FIELDS=(F2:1,24)
SORT FIELDS=(17,8,ZD,A)
OUTREC BUILD=(1,16)
/*
//JNF2CNTL DD *
INREC OVERLAY=(17:SEQNUM,8,ZD)
/*
|
If you don't have the Nov, 2009 PTF, ask your System Programmer to install it (it's free). For details, see:
ibmmainframes.com/viewtopic.php?t=45147
If you can't use JOINKEYS, let me know and I'll show you how to do it in multiple passes with ICETOOL. |
|