View previous topic :: View next topic
|
Author |
Message |
nimisanand
New User
Joined: 22 Nov 2005 Posts: 24
|
|
|
|
Hi,
I have two files. The content of the first file is as below.
Name Emp ID Dept
Tim 13333 Sales
John 14222 Marketing
Kim 12784 Administration
Johny 11344 Authorisation
Lilly 19345 Sales
Mary 78934 Finance
The second file has the Dept only
Dept
Authorisation
Finance
Sales
Only records which have department present in the second file needs to be written in the output file.
Output file
Name Emp ID Dept
Tim 13333 Sales
Johny 11344 Authorisation
Lilly 19345 Sales
Mary 78934 Finance
Please let me know if this could be done using DFSORT/ICETOOL.
Regards,
Nimi |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
It seems like after 6 years you would know to provide the LRECL and format for the files and the field positions and lengths for the fields. |
|
Back to top |
|
|
nimisanand
New User
Joined: 22 Nov 2005 Posts: 24
|
|
|
|
Both files are FB format with both having LREC 80.
Record layout for the first file
Name X(20)
Emp-ID 9(10)
Department X(30)
Second file Layout
X(30) |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT JOINKEYS job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD *
Tim 13333Sales
John 14222Marketing
Kim 12784Administration
Johny 11344Authorisation
Lilly 19345Sales
Mary 78934Finance
/*
//IN2 DD *
Dept
Authorisation
Finance
Sales
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS F1=IN1,FIELDS=(31,30,A)
JOINKEYS F2=IN2,FIELDS=(1,30,A)
REFORMAT FIELDS=(F1:1,88)
SORT FIELDS=(81,8,ZD,A)
OUTREC BUILD=(1,80)
/*
//JNF1CNTL DD *
INREC OVERLAY=(81:SEQNUM,8,ZD)
/*
|
|
|
Back to top |
|
|
|