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 

Compare records on 2 files

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


Joined: 06 Jul 2005
Posts: 29
Topics: 20

PostPosted: Tue Jun 03, 2008 1:53 pm    Post subject: Compare records on 2 files Reply with quote

Hi,
I have 2 files

FILEA
ABC 09544 dfhklfhklf
XYZ 12345 roirjlxxxx
CYX 43844 aklsdadla

FILEB
ABC 09544 dfhklfhklf
XYZ 12345 roirjlwekf
LMN 39844 dakdakd

OUTPUT FILE
XYZ 12345 roirjlxxxx
CYX 43844 aklsdadla

I want to compare 2 files A and B where the sort key would be bytes 5-9.
I would be sorting the file on the key.
If any data for FILEA changes for the key from FILE B or a new record is present in FILEA, I want to write it into another file OUTPUT.

Can I do this using ICETOOL.

Any help would be appreciated.

Thanks,
Chikdu.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Jun 03, 2008 2:54 pm    Post subject: Reply with quote

Have you tried reading the DFSORT Tricks PDF? Have you tried searching?
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
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: Tue Jun 03, 2008 3:07 pm    Post subject: Reply with quote

chikdu,

The following DFSORT/ICETOOL Jcl will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                                 
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN1      DD *                                             
ABC 09544 DFHKLFHKLF                                         
XYZ 12345 ROIRJLXXXX                                         
CYX 43844 AKLSDADLA                                         
//IN2      DD *                                             
ABC 09544 DFHKLFHKLF                                         
XYZ 12345 ROIRJLWEKF                                         
LMN 39844 DAKDAKD                                           
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT      DD SYSOUT=*                                       
//TOOLIN   DD *                                             
  COPY FROM(IN2) USING(CTL1)                                 
  COPY FROM(IN1) USING(CTL2)                                 
  SPLICE FROM(T1) TO(OUT) ON(5,5,CH) KEEPNODUPS KEEPBASE -   
  WITHALL WITH(01,80) USING(CTL3)                           
//CTL1CNTL DD *                                             
  OUTFIL FNAMES=T1,OVERLAY=(81:C'22',1,80)                   
//CTL2CNTL DD *                                             
  OUTFIL FNAMES=T1,OVERLAY=(81:C'11',80X)                   
//CTL3CNTL DD *                                             
  OUTFIL FNAMES=OUT,BUILD=(1,80),                           
  INCLUDE=((81,2,CH,EQ,C'22',AND,11,70,CH,NE,93,70,CH),OR,   
            81,2,CH,EQ,C'11')                               
/*


Hope this helps...

Cheers

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


Joined: 06 Jul 2005
Posts: 29
Topics: 20

PostPosted: Tue Jun 03, 2008 3:34 pm    Post subject: Reply with quote

Thanks Kolusu for the reply.
But on execution I found that the sort call is processed by SYNCSORT, so I think I will not be able to use this utility. Please let me know if this can be actually processed using syncsort as I am getting an error. Also my record length is FB 899 bytes.So would that be a problem?

Thanks,
Chikdu
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: Tue Jun 03, 2008 3:36 pm    Post subject: Reply with quote

chikdu,

I'm a DFSORT developer. DFSORT and Syncsort are competitive products. 'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bprasanna
Beginner


Joined: 05 Sep 2003
Posts: 119
Topics: 33
Location: Hyderabad

PostPosted: Wed Jun 04, 2008 5:08 am    Post subject: Reply with quote

chikdu,
Please check the below code.

Code:

//S1       EXEC  PGM=SORT                                             
//TOOLMSG  DD SYSOUT=*                                                 
//DFSMSG   DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SORTJNF1 DD *                                                       
ABC 09544 DFHKLFHKLF                                                   
XYZ 12345 ROIRJLXXXX                                                   
CYX 43844 AKLSDADLA                                                   
//SORTJNF2 DD *                                                       
ABC 09544 DFHKLFHKLF                                                   
XYZ 12345 ROIRJLWEKF                                                   
LMN 39844 DAKDAKD                                                     
//MYOUT    DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  JOINKEYS FILES=F1,FIELDS=(05,05,A)                                   
  JOINKEYS FILES=F2,FIELDS=(05,05,A)                                   
  JOIN UNPAIRED,F1                                                     
  REFORMAT FIELDS=(F1:1,20,F2:1,20)                                   
  SORT FIELDS=COPY                                                     
  OUTFIL FNAMES=MYOUT,INCLUDE=(1,20,CH,NE,21,20,CH,OR,21,2,CH,EQ,C' '),
  OUTREC=(1,20)                                                       


MYOUT will have the o/p as below.

XYZ 12345 ROIRJLXXXX
CYX 43844 AKLSDADLA

Thanks
Bprasanna
_________________
----------------
Thanks&Regards
Bprasanna
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