Joined: 23 Jan 2004 Posts: 40 Topics: 16 Location: Bangalore
Posted: Tue Nov 01, 2005 2:51 pm Post subject: Compare 2 Files using sort
Hi
We have 2 files with length 80 bytes each and we need to compare the first 10 bytes of each record in the file and and write the entire record into output if they are equal(first 10 bytes).
Posted: Tue Nov 01, 2005 4:42 pm Post subject: Compare two files using sort
Kolusu,
I have a requirement in which i want to compare two input files both of same format and length of only the first 5 bytes ,if they are equal i want to write those particluar records into a separate file without duplicates.
Code:
TECH022.DATA.ICE1
********************************* Top of Data **********************************
12345 RAM
33333 SENTHIL
78888 VENU
******************************** Bottom of Data ********************************
TECH022.DATA.ICE2
********************************* Top of Data **********************************
12345 RAM
21156 MAHESH
33333 SENTHIL
78900 PRAKASH
******************************** Bottom of Data ********************************
So i tried your JCL like below but i am not getting the desired output which i am expecting ,moreover i am getting records in duplicate.
********************************* Top of Data **********************************
12345 RAM
12345 RAM
33333 SENTHIL
33333 SENTHIL
******************************** Bottom of Data ********************************
DESIRED OUTPUT
--------------------
Code:
********************************* Top of Data **********************************
12345 RAM
33333 SENTHIL
******************************** Bottom of Data ********************************
My understanding is that if we are using keyword ALLDUPS,the duplicate records are being printed in the output file.But if i am using keyword NODUPS i am getting the output below with non matching records,that means the records not matching are printed in the output file.Please guide me how do i get my desired output.
********************************* Top of Data **********************************
21156 MAHESH
78888 VENU
78900 PRAKASH
******************************** Bottom of Data ********************************
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Nov 01, 2005 5:31 pm Post subject:
Shekar123 wrote
Quote:
My understanding is that if we are using keyword ALLDUPS,the duplicate records are being printed in the output file.But if i am using keyword NODUPS i am getting the output below with non matching records,that means the records not matching are printed in the output file.Please guide me how do i get my desired output.
You need to understand what each of the DFSORT/ICETOOL SELECT criteria keywords does in order to pick the right keyword. ALLDUPS selects all of the matched records. NODUPS selects each non-matched record. FIRSTDUP selects the first record of the matched records. FIRST selects the first record of the matched records and each non-matched record. And so on.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
BTW, Kolusu is not the only person on this board who can answer questions so you might not want to address your questions only to him. Admittedly, Kolusu usually responds faster than anybody else on this board and has a great deal of knowledge about a great deal of subjects. But some of the rest of us do occasionally get to answer a question here, and do have some specific knowledge. (FYI, I'm the DFSORT developer who "invented" DFSORT's ICETOOL and added every new function to it so I do know a bit about it). _________________ 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
Admittedly, Kolusu usually responds faster than anybody else on this board and has a great deal of knowledge about a great deal of subjects. But some of the rest of us do occasionally get to answer a question here, and do have some specific knowledge
I second this. Sometimes I feel why am I soo slow in thinking abt the solution. Or soo Stupid... in giving solutions.
I think the best time you can respond to solutions is night (USA). ... By the way kolusu, when do you sleep ...
Kolusu.. (Asking him as hez the site moderator) Plz give me edit access for my posts.
>>>Think I have told you Frank, I love your signature and wish I could have something like that.. You are one of the persons who I know (thru this site) and has given solutions continously. I remember you just like my Math teacher.
(a+b)<sup>2</sup>= a <sup>2</sup>+ b <sup>2</sup> + 2 ab
The documentation of DFSORT is really good and its with lot of examples. We have SYNCSORT in our shop and I cannot make use of SPLICE operator. But felt that thru SORT utility we can avoid a lot of simple PL1/COBOL coding. Due to your helpful hints and solutions I now know a bit in using SORT utility.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Tue Nov 01, 2005 6:45 pm Post subject:
Ravi wrote
Quote:
Frank, I love your signature and wish I could have something like that
Well, thanks for the kind words, but the only way you could have a signature like mine would be if you were on the DFSORT Team. Did you perhaps mean my avatar (Professor Rat)? Kolusu was kind enough to help me set it up on this site. I really like it since it reminds me of my wonderful pet rats (Rose, Gracie, April and June).
As to how Kolusu answers so fast, I'm guessing that he monitors the site at least once every ten minutes. _________________ 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
Posted: Wed Nov 02, 2005 12:52 am Post subject: Compare 2 Files using sort
Hi Frank Yaeger,
I really did not mean to address my query to Kolusu only(specific),actually if you see to what i have questioned,it is a continuation of Kolusu's replies to Sateesh_gontla.I just wanted to try out for my learning purpose.I have no intention in higlighting only one person in our forum and all our moderators are well experienced in the technologies and i have a gained a lot in improving my skills after i have joined this website.The answers to queries posted by members is answered in no time and this is the best site as of my knowledge.And for a beginer like me i cannot think of anything else / training to improve skills other than this website.
Frank,I was really surprised to see the links provided by and yourself being the part of DFSORT team .The content and the examples in the mini tutorial will defintely help me a lot and i have started reading through basic chapters.It is nice to have a experienced person like you as one of our moderator in specific area who can share wide experince with the members.
Well regarding Kolusu,i guess and i see that he answers to questions well early in the morning before 5:AM USA time as he gets up and i cannot say any more words for the work he does for our website.He for sure refreshes the helpboards screen surely once every ten minutes.Moderators please do keep up the good work you people are doing. _________________ Shekar
Grow Technically
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Wed Nov 02, 2005 5:22 am Post subject:
Quote:
Admittedly, Kolusu usually responds faster than anybody else on this board and has a great deal of knowledge about a great deal of subjects. But some of the rest of us do occasionally get to answer a question here, and do have some specific knowledge. (FYI, I'm the DFSORT developer who "invented" DFSORT's ICETOOL and added every new function to it so I do know a bit about it).
I try to correct users whenever I can. The worse is I also get credit for not answering the question as most of the new users think that I answered the question by default.
Quote:
As to how Kolusu answers so fast, I'm guessing that he monitors the site at least once every ten minutes.
I usually get a notification when a new post comes thru. So I just look at it right away If I am not busy. If a Solution does not require any testing then I right away answer it.
Quote:
Well regarding Kolusu,i guess and i see that he answers to questions well early in the morning before 5:AM USA time as he gets up and i cannot say any more words for the work he does for our website.
Well my typical day begins at 5 AM . I just answer questions before going to work and monitor the board from work.
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