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=* 
//SYSIN    DD * 
  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 

A1        MATCHED RECORD
B1        MATCHED RECORD
C1        MATCHED RECORD
D1        ONLY FILE2 REC
E1        ONLY 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 <IBM-MAIN@bama.ua.edu> wrote on 05/24/2012 
12:50:52 AM:

> From: Zaromil Tisler <zaromil-ibmn...@chello.at>
> To: IBM-MAIN@bama.ua.edu, 
> Date: 05/24/2012 12:52 AM
> Subject: Comparing datasets
> Sent by: IBM Mainframe Discussion List <IBM-MAIN@bama.ua.edu>
> 
> 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:
> .OAAAA C1
> .OAAAB B1
> 000003 A1
> ====== B1
> ====== C1
> 
> Result of editing B and comparing it to A:
> .OAAAA A1
> .OAAAB B1
> 000003 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

Reply via email to