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 

Need to generate a comparison report between two files

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


Joined: 24 Dec 2008
Posts: 7
Topics: 3
Location: India

PostPosted: Fri Dec 26, 2008 4:23 am    Post subject: Need to generate a comparison report between two files Reply with quote

Hi,

I have two files :
FILE-1 :-
Code:

Item no   Class   colour   special number  manufacturer
--------------------------------------------------------
BC111       A   Green      1234.12.1234    ABCD corp
TPK14562    J   yellow     2324.65.5645    JJGroup
1A2345      B   Red        4345.13.2222    CD Group
1A2345      J   Red        4345.13.2222    CD Group
0S334456   CA   Blue       5676.32.1524    HL Corp
0123545     C   Black      5355.76.8787    JJ Group


File-2 :-
Code:
Item no   Class   colour   special number   manufacturer
-------------------------------------------------------
BC111       A   Green      1234.12.1234    ABCD corp
1A2345      B   Red        4345.13.2222    CD Group
1A2345      J   Red        4345.13.2222    CD Group
0S334456   CA   Blue       4444.44.4444    HL Corp
1G47896     B   Red        2123.34.4234    GB Corp
0123545     C   Black      5355.76.8787    JJ Group



What is happening is, we have this special number gets changed over a period of time and that is what we are suppose to check and track in out report.


OUTPUT :-
Code:

Item no   Class   Old special         New special  Change Type
                     number              number
----------------------------------------------------------------
TPK14562    J     2324.65.5645                      DEL
0S334456   CA     5676.32.1524      4444.44.4444    CHG
1G47896     B     2123.34.4234                      NEW



Could you please suggest how can I do it using ICETOOL ?

Thanks in advance,
Akash
Back to top
View user's profile Send private message
akash_rgh
Beginner


Joined: 24 Dec 2008
Posts: 7
Topics: 3
Location: India

PostPosted: Fri Dec 26, 2008 6:04 am    Post subject: Reply with quote

The combination of item number and class in first two columns makes a unique combinaition...

The output report tells whether the special number has got chnaged, added newly or deleted...
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Dec 26, 2008 11:45 am    Post subject: Reply with quote

akash_rgh,

Please answer the following questions

1. What is the LRECL and RECFM of the input files?
2. Can their be duplicates for the combination of item number and class ?
3. Post the COBOL layout of the files.
4. If the Combination keys match is the special number the only field to be compared?
5. Does the files have the 2 line header
Code:

Item no   Class   colour   special number  manufacturer
--------------------------------------------------------

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


Joined: 24 Dec 2008
Posts: 7
Topics: 3
Location: India

PostPosted: Mon Dec 29, 2008 2:55 am    Post subject: Reply with quote

Hi Kolusu,

Please find the details below :

1. LRECL 141 and RECFM =FB.
2. No duplicates possible for the combination of item number and class.
3. Item no 20 bytes
Class 2 bytes
colour 10 bytes
special number 12 bytes
manufacturer 40 bytes
while the rest is filler
4. Yes, we first need to check the item number and class combination match in other file and if matched then only we need to compare the special number field for any changes.
5. No none of the files have any headers.

Thanks in advance,
Akash
Back to top
View user's profile Send private message
akash_rgh
Beginner


Joined: 24 Dec 2008
Posts: 7
Topics: 3
Location: India

PostPosted: Mon Dec 29, 2008 2:58 am    Post subject: Reply with quote

In output file we will in third example we will have the special number under new special number column while the old one will remain blank. In my query above it looks like in old column.
_________________
-AK
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Mon Dec 29, 2008 4:07 pm    Post subject: Reply with quote

Hello Akash,

I know in your original post that you requested an ICETOOL solution, but if you have access to SyncSort for z/OS 1.2 or 1.3, then try the following job:
Code:
//STEP1  EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD DSN=OUTPUT.DATASET,...                                           
//SORTJNF1 DD *                                               
BC111                    A  GREEN      1234.12.1234  ABCD CORP
TPK14562                 J  YELLOW     2324.65.5645  JJGROUP   
1A2345                   B  RED        4345.13.2222  CD GROUP 
1A2345                   J  RED        4345.13.2222  CD GROUP 
0S334456                CA  BLUE       5676.32.1524  HL CORP   
0123545                  C  BLACK      5355.76.8787  JJ GROUP 
//SORTJNF2 DD *                                                   
BC111                    A  GREEN      1234.12.1234  ABCD CORP     
1A2345                   B  RED        4345.13.2222  CD GROUP     
1A2345                   J  RED        4345.13.2222  CD GROUP     
0S334456                CA  BLUE       4444.44.4444  HL CORP       
1G47896                  B  RED        2123.34.4234  GB CORP       
0123545                  C  BLACK      5355.76.8787  JJ GROUP
//SYSIN    DD *                                                   
  JOINKEYS FILES=F1,FIELDS=(1,20,A,25,2,A)                     
  JOINKEYS FILES=F2,FIELDS=(1,20,A,25,2,A)                     
  JOIN UNPAIRED                                                 
  REFORMAT FIELDS=(F1:1,26,40,12,F2:1,26,40,12)                 
  SORT FIELDS=COPY                                             
  OUTFIL OMIT=(1,38,CH,EQ,39,38,CH),                           
    IFTHEN=(WHEN=(1,38,CH,EQ,C' '),                             
      BUILD=(1:39,26,45:65,12,60:C'NEW')),                     
    IFTHEN=(WHEN=(39,34,CH,EQ,C' '),                           
      BUILD=(1:1,26,30:27,12,60:C'DEL')),                       
    IFTHEN=(WHEN=(1,26,CH,EQ,39,26,CH,AND,27,12,CH,NE,65,12,CH),
      BUILD=(1:1,26,30:27,12,45:65,12,60:C'CHG'))               
/*     

Here is the output produced:
Code:
TPK14562                 J   2324.65.5645                  DEL
0S334456                CA   5676.32.1524   4444.44.4444   CHG
1G47896                  B                  2123.34.4234   NEW

_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Dec 30, 2008 2:15 pm    Post subject: Reply with quote

akash_rgh,

The following DFSORT JCL will give you the desired results. Since both files have same LRECL we can concatenate them together but seperated by a header record which will be used to distinguish as to which file the record came from

when concatenated together this is how it looks like. For the first file we use HEADER-11 and for the second file we use HEADER-22

Code:

HEADER-11                                                 
BC111                A GREEN    1234.12.1234    ABCD CORP
TPK14562             J YELLOW   2324.65.5645    JJGROUP   
1A2345               B RED      4345.13.2222    CD GROUP 
1A2345               J RED      4345.13.2222    CD GROUP 
0S334456            CA BLUE     5676.32.1524    HL CORP   
0123545              C BLACK    5355.76.8787    JJ GROUP 
HEADER-22                                                 
BC111                A GREEN    1234.12.1234    ABCD CORP
1A2345               B RED      4345.13.2222    CD GROUP 
1A2345               J RED      4345.13.2222    CD GROUP 
0S334456            CA BLUE     4444.44.4444    HL CORP   
1G47896              B RED      2123.34.4234    GB CORP   
0123545              C BLACK    5355.76.8787    JJ GROUP 



Code:

//STEP0100 EXEC PGM=ICEMAN                                     
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=a 140 byte 1 record header file1,DISP=SHR
//         DD DSN=your input 140 byte file1,DISP=SHR
//         DD DSN=a 140 byte 1 record header file2,DISP=SHR
//         DD DSN=your input 140 byte file1,DISP=SHR
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  OPTION EQUALS                                                 
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,22,33,12,12Z)),             
  IFTHEN=(WHEN=GROUP,BEGIN=(1,6,CH,EQ,C'HEADER'),PUSH=(47:8,2)),
  IFTHEN=(WHEN=(47,2,ZD,EQ,22),OVERLAY=(35:23,12,23:12Z))       
                                                               
  SORT FIELDS=(1,22,CH,A)                                       
  SUM FIELDS=(23,8,31,8,39,8),FORMAT=BI                         
  OUTREC BUILD=(1,22,23,24,TRAN=ALTSEQ)                         
  ALTSEQ CODE=(0040)                                           
  OUTFIL IFOUTLEN=51,                                           
  OMIT=(23,12,CH,EQ,35,12,CH,OR,1,6,CH,EQ,C'HEADER'),           
  IFTHEN=(WHEN=(23,12,CH,EQ,C' '),OVERLAY=(49:C'NEW')),         
  IFTHEN=(WHEN=(35,12,CH,EQ,C' '),OVERLAY=(49:C'DEL')),         
  IFTHEN=(WHEN=NONE,OVERLAY=(49:C'CHG'))                       
/*                                                             


The output from this job is

Code:

TPK14562             J2324.65.5645              DEL
0S334456            CA5676.32.15244444.44.4444  CHG
1G47896              B            2123.34.4234  NEW


Hope this helps...

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


Joined: 24 Dec 2008
Posts: 7
Topics: 3
Location: India

PostPosted: Fri Jan 02, 2009 3:27 am    Post subject: Reply with quote

yupp, it worked, Thanks a lot to both of you Smile
_________________
-AK
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