View previous topic :: View next topic |
Author |
Message |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Wed Jul 23, 2008 8:45 am Post subject: Need a SYNCSORT solution...please ! |
|
|
Hi,
We are using SYNCSORT FOR Z/OS 1.2.2.1R.
My requirement is as give below:
I have two files to compare.
1st File:
2nd File:
Code: |
01 ##00002
02 ##00002
03 ##00002
07 ##00002
08 ##00002
14 ##00002
19 ##00002
99 ##00002
01 ##00093
02 ##00093
03 ##00093
07 ##00093
08 ##00093
14 ##00093
19 ##00093
99 ##00093
01 ##00193
02 ##00193
03 ##00193
07 ##00193
08 ##00193
14 ##00193
19 ##00193
99 ##00193
|
The requirement is to copy the records from 2nd file if the number matches between 1st and 2nd files. So, the output should look as given below:
Code: |
01 ##00002
02 ##00002
03 ##00002
07 ##00002
08 ##00002
14 ##00002
19 ##00002
99 ##00002
01 ##00093
02 ##00093
03 ##00093
07 ##00093
08 ##00093
14 ##00093
19 ##00093
99 ##00093
|
Note: Number starts in 1st column in 1st file and in 6th column in 2nd file.
Please help me with a SYNCSORT solution.
TIA. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Jul 23, 2008 9:40 am Post subject: |
|
|
sorry if I hurt your FEELINGS, but have you bothered to look thru the threads in the utilites forum? even though the recl is different and what you are trying to compare is different, the mechanics are the same.
search for alisa m's posts. they all concern syncsort. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Wed Jul 23, 2008 9:55 am Post subject: |
|
|
dbzTHEdinosauer,
I did search and found few entries that used JOINKEYS concept. I tried to modify one but always ended up getting different output.
I thought, will ask expert's help on this.
Thanks. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
Back to top |
|
 |
amargulies Beginner
Joined: 10 Jan 2007 Posts: 123 Topics: 0
|
Posted: Wed Jul 23, 2008 11:18 am Post subject: |
|
|
Here is a SyncSort job that should give you the desired results:
Code: | //SORT1 EXEC PGM=SORT
//SORTJNF1 DD *
01 ##00002
02 ##00002
03 ##00002
07 ##00002
08 ##00002
14 ##00002
19 ##00002
99 ##00002
01 ##00093
02 ##00093
03 ##00093
07 ##00093
08 ##00093
14 ##00093
19 ##00093
99 ##00093
01 ##00193
02 ##00193
03 ##00193
07 ##00193
08 ##00193
14 ##00193
19 ##00193
99 ##00193
//SORTJNF2 DD *
##00002
##00093
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(6,7,A)
JOINKEYS FILES=F2,FIELDS=(1,7,A)
REFORMAT FIELDS=(F1:1,12)
SORT FIELDS=COPY
/* |
_________________ Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com |
|
Back to top |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Wed Jul 23, 2008 12:25 pm Post subject: Thank you very much. |
|
|
Hi, Alissa.
Thank you very much for your immediate help. I've started writing COBOL program to achieve it.
You saved my time.
Have a good day. _________________ MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
== |
|
Back to top |
|
 |
amargulies Beginner
Joined: 10 Jan 2007 Posts: 123 Topics: 0
|
Posted: Wed Jul 23, 2008 2:04 pm Post subject: |
|
|
MF,
Glad I could help. _________________ Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com |
|
Back to top |
|
 |
|
|