MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tricky file compare

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
suresh05
Beginner


Joined: 14 Sep 2005
Posts: 18
Topics: 8

PostPosted: Thu Sep 15, 2005 10:21 am    Post subject: Tricky file compare Reply with quote

Hi,
I wanted to know if this file comparison can be done using Syncsort. Please help me..

File 1

Field-1 Field-2
12345 11111
12345 22222
12346 11222
12346 11333
12333 33333
12333 44444

File 2

Field-1
11111
12345
22222
11333
33333
11222
12346
44444


Output File
12345
11111
22222
12346
11222
11333

Condition is
If there is a match between File1 field-1 and File2 field-2 then file2 should be written to output file.
Then File1 field2 should be compared with File2 field 2 and if there is a match file2 should be written to the output file.
Else
Skip to the next record (record should not be written to the output file)

record should be of same order of File-1 sequence.

Please help me if this comparison can be done using Syncsort.
Both the files are FB lrecl 80 and the key fields is PIC 9(5)
Only File 1 field1 will have duplicates remaining key fields in File1 filed2 & File2 Field 1 are unique
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Thu Sep 15, 2005 10:37 am    Post subject: Reply with quote

Quote:

If there is a match between File1 field-1 and File2 field-2 then file2 should be written to output file.
Then File1 field2 should be compared with File2 field 2 and if there is a match file2 should be written to the output file.


Where is field-2 in file2?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
suresh05
Beginner


Joined: 14 Sep 2005
Posts: 18
Topics: 8

PostPosted: Thu Sep 15, 2005 11:00 am    Post subject: Reply with quote

oops sorry. it's File2 field-1
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Sep 16, 2005 6:19 am    Post subject: Reply with quote

Suresh05,

There are already tons of questions answered on file comparison / matching. Please take some time and see if you can build on that.

Anyway, I have no problems answering this question. But looking at your input files, the keys does not appear Unique. So, the regular MATCH Logic (SUM FIELDS) won't work for you. You need to go in for SPLICE which is actually an unsupported-undocumented feature of Syncsort.

SPLICE is available only with Syncsort v 1.1 and above. So, write some dummy sort step and post your sysout message. The first line contains the Syncsort version your shop is running on.

Thanks,
Phantom
Back to top
View user's profile Send private message
suresh05
Beginner


Joined: 14 Sep 2005
Posts: 18
Topics: 8

PostPosted: Fri Sep 16, 2005 6:24 am    Post subject: Reply with quote

I have Syncsort 1.4.0

z/OS 1.4.0 CPU MODEL 2084
Back to top
View user's profile Send private message
suresh05
Beginner


Joined: 14 Sep 2005
Posts: 18
Topics: 8

PostPosted: Fri Sep 16, 2005 6:33 am    Post subject: Reply with quote

Sorry .. it's SYNCSORT 3.7DR
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Sep 16, 2005 6:35 am    Post subject: Reply with quote

Suresh05,

I think you are looking at the output of Synctool. Thats not the one you need to look at. The latest version of Syncsort is v 1.2. use PGM=SORT and show us the SYSOUT. (Don't use PGM=SYNCTOOL/ICETOOL).

Thanks,
Phantom
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12369
Topics: 75
Location: San Jose

PostPosted: Fri Sep 16, 2005 7:41 am    Post subject: Reply with quote

Phantom,

Suresh has syncsort v 3.7 which is a old version and splice is not supported in that version. see his post just above your post.

However his problem can be solved without splice, but I don't have time to work on it.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Sep 16, 2005 11:42 pm    Post subject: Reply with quote

Kolusu,

My message was with reference to "z/OS 1.4.0 CPU MODEL 2084". probably both of us wrote at the same time. Also, after sending in my reply I went to Forums Index. So, didn't get a chance to see and correct myself. My apologies. Hope you remember that I was working on the same version of sort sometime back !...

Suresh05,

Syncsort 3.7 does not support SPLICE and many other powerful features. So, writing a code for you will be all the more tricky. we have to use Dynamic (INCLUDE COND=) sort control cards. But there is a limitation on the number of records that can be accomodated in such dynamic cards (Although there is a way to overcome this by using MINCORE parm).

How many unique records can you expect in your file 1 and file 2. In case of file1, I need unique count of field 1 and field 2 separately. If they are in few hundreds we can do using dynamic INCLUDEs. Else this is not possible with your version of sort.

Thanks,
Phantom
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group