View previous topic :: View next topic |
Author |
Message |
bprasanna Beginner
Joined: 05 Sep 2003 Posts: 119 Topics: 33 Location: Hyderabad
|
Posted: Tue Mar 08, 2005 8:44 am Post subject: Can we do this via Sort? |
|
|
Hi,
I am having 2 files with FB and lrec as 80.The data of the files is like below.
File1:
XXXXXX1 0 CA07 NVM@3
PS010
PS020
PS030
XXXXXX2 0 CA07 NVM@3
PS010
PS020
PS030
XXXXXX3 0 CA07 NVM@3
PS010
PS020
PS030
File2:
NVM@3 AAAAAAA BBBBBBBBBBBB
PS010 AAAAAAA ASASASASAASS
PS030 AAAAAAAA AAAAAAAAAAAA
PS040 AAAAAAA AAASSSSSAAAA
PS050 AAAAAAA AAAAAAAAAAAAA
NVM@3 AAAAAAA BBBBBBBBBBBB
PS010 AAAAAAA ASASASASAASS
PS030 AAAAAAAA AAAAAAAAAAAA
NVM@3 AAAAAAA BBBBBBBBBBBB
PS010 AAAAAAA ASASASASAASS
PS030 AAAAAAAA AAAAAAAAAAAA
Now I need to create a new file like below.
XXXXXX1 NVM@3 AAAAAAA BBBBBBBBBBBB
XXXXXX1 ps010 AAAAAAA ASASASASAASS
XXXXXX1 PS030 AAAAAAAA AAAAAAAAAAAA
XXXXXX1 PS040 AAAAAAA AAASSSSSAAAA
XXXXXX1 PS050 AAAAAAA AAAAAAAAAAAAA
XXXXXX2 NVM@3 AAAAAAA BBBBBBBBBBBB
XXXXXX2 ps010 AAAAAAA ASASASASAASS
XXXXXX2 ps020
XXXXXX2 ps030 AAAAAAA AAAAAAAAAAAA
XXXXXX3 NVM@3 AAAAAAA BBBBBBBBBBBB
XXXXXX3 ps010 AAAAAAA ASASASASAASS
XXXXXX3 ps020
XXXXXX3 ps030 AAAAAAA AAAAAAAAAAAA
is this possible to achive throught Sort? Here the number of records in both the files are not
same.But the number of NVM@3 are equal in both the files.Ezt solution is also ok to me.
Thanks
Prasanna |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Tue Mar 08, 2005 11:41 am Post subject: |
|
|
It's not clear what you're trying to do. For XXXXXX1, you don't include the PS020 record in the output, but for XXXXXX2 and XXXXXX3, you do. Why? _________________ 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 |
|
Back to top |
|
 |
bprasanna Beginner
Joined: 05 Sep 2003 Posts: 119 Topics: 33 Location: Hyderabad
|
Posted: Wed Mar 09, 2005 1:36 am Post subject: |
|
|
Sorry Frank,
I need to include the PS020 IN XXXXXX1 as well.But I need the solution with SYNCSORT.
Thanks |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Mar 09, 2005 10:29 am Post subject: |
|
|
bprasanna,
What is the matching field in both the files? is it NVM@? There are multiple NVM@3 records in both the files. How do you link the records?
Is the matching to be done by sets ?
Since you are interested in syncsort solution , please post the version of syncsort you have . Run the following job.You can find this as the first line in your sysout.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
TEST
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
/*
|
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|