Re: Comparing datasets
It's not ISPF, but ICETOOL should be able to give you what you want. Look up the OCCUR operator. Rex -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Zaromil Tisler Sent: Thursday, May 24, 2012 2:51 AM To: IBM-MAIN@bama.ua.edu Subject: Comparing datasets Is there z/OS (ISPF) tool that can check if all lines of dataset A are contained in dataset B? In other words, is there a tool that could check if dataset A is a subset of dataset B, where A and B are sets of records (lines)? I can accomplish it using COMPARE ISPF edit function or SuperC Compare Utility, but datasets have to be sorted. Example: dataset A content: C1 B1 A1 dataset B content: A1 B1 C1 Result of editing A and comparing it to B: .O C1 .OAAAB B1 03 A1 == B1 == C1 Result of editing B and comparing it to A: .O A1 .OAAAB B1 03 C1 == B1 == A1 Background: I wanted to check if all cross product dependency PTFs of product A are already applied in product B. I generated two datasets, A and B respectively, and compared them in ISPF editor using COMPARE function. I was surprised with result so I read the tutorial looking for any parameter that could influence this behaviour, but haven't found any. There were no porblems to sort both datasets in this case, I am just curious. (Later I tried to do this on my pc and it worked in Notepad++). -- Zaromil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN The information contained in this e-mail may contain confidential and/or privileged information and is intended for the sole use of the intended recipient. If you are not the intended recipient, you are hereby notified that any unauthorized use, disclosure, distribution or copying of this communication is strictly prohibited and that you will be held responsible for any such unauthorized activity, including liability for any resulting damages. As appropriate, such incident(s) may also be reported to law enforcement. If you received this e-mail in error, please reply to sender and destroy or delete the message and any attachments. Thank you. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN
Re: Comparing datasets
Zaromil, You can use DFSORT's JOINKEYS to compare the datasets. Here is a sample job which will compare the 2 datasets treating the first 2 bytes as a key to compare. You can have a maximum of 4080 bytes as a key. //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //INA DD * C1 B1 A1 E1 //INB DD * A1 B1 C1 D1 //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY JOINKEYS F1=INA,FIELDS=(1,2,A) JOINKEYS F2=INB,FIELDS=(1,2,A) JOIN UNPAIRED REFORMAT FIELDS=(F1:1,10,F2:1,10,?) OUTFIL IFOUTLEN=25, IFTHEN=(WHEN=(21,1,CH,EQ,C'B'),BUILD=(01,10,C'MATCHED RECORD')), IFTHEN=(WHEN=(21,1,CH,EQ,C'1'),BUILD=(01,10,C'ONLY FILE1 REC')), IFTHEN=(WHEN=(21,1,CH,EQ,C'2'),BUILD=(11,10,C'ONLY FILE2 REC')) //* The output from this job is A1MATCHED RECORD B1MATCHED RECORD C1MATCHED RECORD D1ONLY FILE2 REC E1ONLY FILE1 REC Check this link for a detailed explanation of JOINKEYS http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/4.0? Further if you have any questions please let me know Thanks, Sri Hari Kolusu DFSORT Development IBM Corporation Email: skol...@us.ibm.com Phone: 408-463-2403 Tie Line 543-2403 IBM Mainframe Discussion List wrote on 05/24/2012 12:50:52 AM: > From: Zaromil Tisler > To: IBM-MAIN@bama.ua.edu, > Date: 05/24/2012 12:52 AM > Subject: Comparing datasets > Sent by: IBM Mainframe Discussion List > > Is there z/OS (ISPF) tool that can check if all lines of dataset A > are contained in dataset B? In other words, is there a tool that > could check if dataset A is a subset of dataset B, where A and B are > sets of records (lines)? I can accomplish it using COMPARE ISPF edit > function or SuperC Compare Utility, but datasets have to be sorted. > > Example: > > dataset A content: > C1 > B1 > A1 > > dataset B content: > A1 > B1 > C1 > > > Result of editing A and comparing it to B: > .O C1 > .OAAAB B1 > 03 A1 > == B1 > == C1 > > Result of editing B and comparing it to A: > .O A1 > .OAAAB B1 > 03 C1 > == B1 > == A1 > > > Background: I wanted to check if all cross product dependency PTFs > of product A are already applied in product B. I generated two > datasets, A and B respectively, and compared them in ISPF editor > using COMPARE function. I was surprised with result so I read the > tutorial looking for any parameter that could influence this > behaviour, but haven't found any. There were no porblems to sort > both datasets in this case, I am just curious. > > (Later I tried to do this on my pc and it worked in Notepad++). > > -- > Zaromil > > -- > For IBM-MAIN subscribe / signoff / archive access instructions, > send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN > -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN
Re: Comparing datasets
Very cool! Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Sri h Kolusu Sent: Thursday, May 24, 2012 8:35 AM To: IBM-MAIN@bama.ua.edu Subject: Re: Comparing datasets Zaromil, You can use DFSORT's JOINKEYS to compare the datasets. Here is a sample job which will compare the 2 datasets treating the first 2 bytes as a key to compare. You can have a maximum of 4080 bytes as a key. //STEP0100 EXEC PGM=SORT //SYSOUT DD SYSOUT=* //INA DD * C1 B1 A1 E1 //INB DD * A1 B1 C1 D1 //SORTOUT DD SYSOUT=* //SYSINDD * OPTION COPY JOINKEYS F1=INA,FIELDS=(1,2,A) JOINKEYS F2=INB,FIELDS=(1,2,A) JOIN UNPAIRED REFORMAT FIELDS=(F1:1,10,F2:1,10,?) OUTFIL IFOUTLEN=25, IFTHEN=(WHEN=(21,1,CH,EQ,C'B'),BUILD=(01,10,C'MATCHED RECORD')), IFTHEN=(WHEN=(21,1,CH,EQ,C'1'),BUILD=(01,10,C'ONLY FILE1 REC')), IFTHEN=(WHEN=(21,1,CH,EQ,C'2'),BUILD=(11,10,C'ONLY FILE2 REC')) //* The output from this job is A1MATCHED RECORD B1MATCHED RECORD C1MATCHED RECORD D1ONLY FILE2 REC E1ONLY FILE1 REC Check this link for a detailed explanation of JOINKEYS http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/4.0? -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN
Re: Comparing datasets
Wow! Thank you for this recipe and information about JOINKEYS. I had to play a bit with REFORMAT to understand it and get what I need. Before you post this, I have already found SPLICE example 8 in the same publication and was also able to get the results I wanted. I would never come to JOINKEYS myself. Have a nice day! -- Zaromil On Thu, 24 May 2012 08:34:44 -0700, Sri h Kolusu wrote: >Zaromil, > >You can use DFSORT's JOINKEYS to compare the datasets. Here is a sample >job which will compare the 2 datasets treating the first 2 bytes as a key >to compare. You can have a maximum of 4080 bytes as a key. > >//STEP0100 EXEC PGM=SORT >//SYSOUT DD SYSOUT=* >//INA DD * >C1 >B1 >A1 >E1 >//INB DD * >A1 >B1 >C1 >D1 >//SORTOUT DD SYSOUT=* >//SYSINDD * > OPTION COPY > JOINKEYS F1=INA,FIELDS=(1,2,A) > JOINKEYS F2=INB,FIELDS=(1,2,A) > JOIN UNPAIRED > REFORMAT FIELDS=(F1:1,10,F2:1,10,?) > OUTFIL IFOUTLEN=25, > IFTHEN=(WHEN=(21,1,CH,EQ,C'B'),BUILD=(01,10,C'MATCHED RECORD')), > IFTHEN=(WHEN=(21,1,CH,EQ,C'1'),BUILD=(01,10,C'ONLY FILE1 REC')), > IFTHEN=(WHEN=(21,1,CH,EQ,C'2'),BUILD=(11,10,C'ONLY FILE2 REC')) >//* > >The output from this job is > >A1MATCHED RECORD >B1MATCHED RECORD >C1MATCHED RECORD >D1ONLY FILE2 REC >E1ONLY FILE1 REC > >Check this link for a detailed explanation of JOINKEYS > >http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/4.0? > >Further if you have any questions please let me know > >Thanks, >Sri Hari Kolusu >DFSORT Development >IBM Corporation -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN
Re: Comparing datasets
Zaromil at IBM Mainframe Discussion List wrote on 05/29/2012 01:32:36 AM: > ... > Before you post this, I have already found SPLICE example 8 in the > same publication and was also able to get the results I wanted. I > would never come to JOINKEYS myself. 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. It can introduce you to the DFSORT and ICETOOL functions you may not know about. You can access it online, along with all of the other DFSORT books, from: http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T780 Frank Yaeger - DFSORT Development Team (IBM) - yae...@us.ibm.com Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration => DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN
Re: Comparing datasets
On 5/29/2012 10:48 AM, Frank Yaeger wrote: Zaromil at IBM Mainframe Discussion List wrote on 05/29/2012 01:32:36 AM: ... Before you post this, I have already found SPLICE example 8 in the same publication and was also able to get the results I wanted. I would never come to JOINKEYS myself. 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. It can introduce you to the DFSORT and ICETOOL functions you may not know about. You can access it online, along with all of the other DFSORT books, from: http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T780 And then, for some intense, hands-on experiences, consider our classroom based class, "Using DFSORT and ICETOOL", 4 days(!). For more details, see: http://www.trainersfriend.com/JCL_courses/B625descrpt.htm -- Kind regards, -Steve Comstock The Trainer's Friend, Inc. 303-355-2752 http://www.trainersfriend.com * To get a good Return on your Investment, first make an investment! + Training your people is an excellent investment * Try our tool for calculating your Return On Investment for training dollars at http://www.trainersfriend.com/ROI/roi.html -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@bama.ua.edu with the message: INFO IBM-MAIN