Compare two datasets. Compare the whole record



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

Compare two datasets. Compare the whole record

Postby crescencio » Fri Jun 12, 2009 4:25 pm

Hi,

I need some help two compare two datasets (Day 1 / Day 2).
The files are FB and 10300 bytes record length.

The records can be matched by key but I need to extract only those that are in Day 2 but not in Day 1 file and those that have changed in some part of the record.

I have found some ideas in this forum, but the only way that I have found to expand the comparision to the whole record is to declare th JOINKEYS to 10300.
It works with test files of 30 bytes but not with real files.
I receive a message like this "WER271A JOINKEYS STATEMENT: NUMERIC FIELD ERROR2".

If you can help with this or can suggest me a different tool that fit better with the request I will appreciate.

Thanks a lot for the help.
crescencio
 
Posts: 6
Joined: Fri Jun 12, 2009 2:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare two datasets. Compare the whole record

 

Re: Compare two datasets. Compare the whole record

Postby Alissa Margulies » Fri Jun 12, 2009 8:16 pm

Please post the JCL you submitted when you received that error. Thank you.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Compare two datasets. Compare the whole record

Postby crescencio » Tue Jun 16, 2009 3:42 pm

Hi,

First I run a JCL like this to test if the idea could work. Considering the first five numeric characters the real key.
000005 //STEP1 EXEC PGM=SORT                                           
000006 //SORTJNF1 DD *                                                 
000007 12345AAAAABBBBBB                                                 
000008 67890CCCCCAAAAAA                                                 
000009 13579DDDDDEEEEEE                                                 
000010 //SORTJNF2 DD *                                                 
000011 12345CCCCCBBBBBB                                                 
000012 13579DDDDDEEEEEE                                                 
000013 08531DDDDDEEEEEE                                                 
000014 //SORTOF01 DD DSN=W#H00I.PRUEBA.TRES,                           
000015 //            DISP=(NEW,CATLG),                                 
000016 //            UNIT=SYSDA,SPACE=(TRK,(100,100))                   
000017 //SYSOUT DD SYSOUT=*                                             
000018 //SYSIN    DD    *                                               
000019   JOINKEYS FILES=F1,FIELDS=(1,16,A)                             
000020   JOINKEYS FILES=F2,FIELDS=(1,16,A)                             
000021   REFORMAT FIELDS=(F2:1,16,F1:1,16),FILL=X'FF'                   
000022   JOIN UNPAIRED,F2                                               
000023   SORT FIELDS=COPY                                               
000024   OUTFIL FILES=01,INCLUDE=(1,1,BI,NE,X'FF',AND,17,1,BI,EQ,X'FF'),
000025       OUTREC=(1,16),FTOV,VLTRIM=X'FF'                           


This JCL produce in dataset PRUEBA.TRES the following output
 DSLIST    W#H00I.PRUEBA.TRES
 Command ===>               
*****************************
08531DDDDDEEEEEE             
12345CCCCCBBBBBB             
*****************************

These two records are Ok because the first one is not in Day 1 file and the second one exits in Day 1 but with different information.

Then I tried with a real JCL like this one.
//STEP1 EXEC PGM=SORT                                               
//SORTJNF1 DD DISP=SHR,DSN=DAY.ONE
//SORTJNF2 DD DISP=SHR,DSN=DAY.TWO                 
//SORTOF01 DD DSN=W#H00I.PRUEBA.CUATRO,                             
//            DISP=(NEW,CATLG),                                     
//            UNIT=SYSDA,SPACE=(TRK,(100,100))                     
//SYSOUT DD SYSOUT=*                                               
//SYSIN    DD    *                                                 
  JOINKEYS FILES=F1,FIELDS=(1,10300,A)                             
  JOINKEYS FILES=F2,FIELDS=(1,10300,A)                             
  REFORMAT FIELDS=(F2:1,10300,F1:1,10300),FILL=X'FF'               
  JOIN UNPAIRED,F2                                                 
  SORT FIELDS=COPY                                                 
  OUTFIL FILES=01,INCLUDE=(1,1,BI,NE,X'FF',AND,10301,1,CH,NE,X'FF'),
      OUTREC=(1,10300),FTOV,VLTRIM=X'FF'                           


And I got the error
  JOINKEYS FILES=F1,FIELDS=(1,10300,A)                             
                              *                                     
  JOINKEYS FILES=F2,FIELDS=(1,10300,A)                             
                              *                                     
  REFORMAT FIELDS=(F2:1,10300,F1:1,10300),FILL=X'FF'               
  JOIN UNPAIRED,F2                                                 
  SORT FIELDS=COPY                                                 
  OUTFIL FILES=01,INCLUDE=(1,1,BI,NE,X'FF',AND,10301,1,CH,NE,X'FF'),
      OUTREC=(1,10300),FTOV,VLTRIM=X'FF'                           
WER271A  JOINKEYS STATEMENT: NUMERIC FIELD ERROR                   
WER271A  JOINKEYS STATEMENT: NUMERIC FIELD ERROR                   


Thanks a lot for your interest.
crescencio
 
Posts: 6
Joined: Fri Jun 12, 2009 2:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare two datasets. Compare the whole record

Postby Alissa Margulies » Tue Jun 16, 2009 9:18 pm

Try this SyncSort for z/OS job:
//STEP1 EXEC PGM=SORT                     
//SYSOUT DD SYSOUT=*                       
//SORTJNF1 DD DSN=DAY.ONE,...
//SORTJNF1 DD DSN=DAY.TWO,...
//SORTOUT DD DSN=NEW.CHANGED.RECORDS,...
//SYSIN DD *                                   
  JOINKEYS FILES=F1,FIELDS=(1,5,A)             
  JOINKEYS FILES=F2,FIELDS=(1,5,A)             
  JOIN UNPAIRED,F2                             
  REFORMAT FIELDS=(F2:1,10300,F1:1,10300)       
  SORT FIELDS=COPY                             
  OUTFIL INCLUDE=(1,256,CH,NE,10301,256,CH,OR,
                257,256,CH,NE,10557,256,CH,OR,
                513,256,CH,NE,10813,256,CH,OR,
                769,256,CH,NE,11069,256,CH,OR,
               1025,256,CH,NE,11325,256,CH,OR,
               1281,256,CH,NE,11581,256,CH,OR,
               1537,256,CH,NE,11837,256,CH,OR,
               1793,256,CH,NE,12093,256,CH,OR,
               2049,256,CH,NE,12349,256,CH,OR,
               2305,256,CH,NE,12605,256,CH,OR,
               2561,256,CH,NE,12861,256,CH,OR,
               2817,256,CH,NE,13117,256,CH,OR,
               3073,256,CH,NE,13373,256,CH,OR,
               3329,256,CH,NE,13629,256,CH,OR,
               3585,256,CH,NE,13885,256,CH,OR,
               3841,256,CH,NE,14141,256,CH,OR,
               4097,256,CH,NE,14397,256,CH,OR,
               4353,256,CH,NE,14653,256,CH,OR,
               4609,256,CH,NE,14909,256,CH,OR,
               4865,256,CH,NE,15165,256,CH,OR,
               5121,256,CH,NE,15421,256,CH,OR,
               5377,256,CH,NE,15677,256,CH,OR,
               5633,256,CH,NE,15933,256,CH,OR,
               5889,256,CH,NE,16189,256,CH,OR,
               6145,256,CH,NE,16445,256,CH,OR,
               6401,256,CH,NE,16701,256,CH,OR,
               6657,256,CH,NE,16957,256,CH,OR,
               6913,256,CH,NE,17213,256,CH,OR,
               7169,256,CH,NE,17469,256,CH,OR,
               7425,256,CH,NE,17725,256,CH,OR,
               7681,256,CH,NE,17981,256,CH,OR,
               7937,256,CH,NE,18237,256,CH,OR,
               8193,256,CH,NE,18493,256,CH,OR,
               8449,256,CH,NE,18749,256,CH,OR,
               8705,256,CH,NE,19005,256,CH,OR,
               8961,256,CH,NE,19261,256,CH,OR,
               9217,256,CH,NE,19517,256,CH,OR,
               9473,256,CH,NE,19773,256,CH,OR,
               9729,256,CH,NE,20029,256,CH,OR,
               9985,256,CH,NE,20285,256,CH,OR,   
               10241,59,CH,NE,20541,59,CH),     
         BUILD=(1,10300)                       
/* 
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: Compare two datasets. Compare the whole record

Postby crescencio » Wed Jun 17, 2009 1:53 pm

yes, it works perfectly.
It was a very good help.

Thanks a lot for your time Alissa.
crescencio
 
Posts: 6
Joined: Fri Jun 12, 2009 2:10 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post