IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

compare files and write out mismatches using DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raja1128

New User


Joined: 09 Jan 2007
Posts: 17
Location: india

PostPosted: Mon Oct 19, 2009 11:54 pm
Reply with quote

Hi all,

Need your help.

I have to compare two files using DFSORT as mentioned below…
Input files and output file have same attributes: recl=41 , PS, FB.
both files have same number of records. Key is first two fields.
every key in first file has a match in second file.
key fields are unique and sorted.

And fields are…

05 AAA PIC S9(11) COMP-3.
05 BBB PIC X(03).
05 CCC PIC S9(11) COMP-3.
05 DDD PIC S9(11) COMP-3.
05 EEE PIC S9(11) COMP-3.
05 FFF PIC X(8).
05 GGG PIC X(6).

Example -
INPUT:
File1:
AA11111
CC33333

File2:
AA44444
CC33333

OUTPUT:
File3: records from file1 where non-key fields do not match with File2 .
AA11111

Thank you.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Oct 20, 2009 1:27 am
Reply with quote

Raj1128,

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

Code:

//STEP0100 EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                             
//SORTIN   DD *                                                   
//SORTOUT  DD DSN=&&HD,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)         
//SYSIN    DD *                                                   
  OPTION COPY                                                     
  OUTFIL REMOVECC,NODETAIL,BUILD=(41X),TRAILER1=('HDR')           
/*                                                                 
//STEP0200 EXEC PGM=ICETOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN       DD DSN=&&HD,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT         
//         DD DSN=your file1,DISP=SHR
//         DD DSN=&&HD,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT         
//         DD DSN=your file2,DISP=SHR                                 
//OUT      DD SYSOUT=*                                             
//TOOLIN   DD *                                                   
  SELECT FROM(IN) TO(OUT) ON(1,6,PD) ON(7,3,CH) NODUPS USING(CTL1)
//CTL1CNTL DD *                                                   
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'HDR'),PUSH=(42:ID=1))
 OUTFIL FNAMES=OUT,BUILD=(1,41),INCLUDE=(42,1,ZD,EQ,1)             
//*
Back to top
View user's profile Send private message
raja1128

New User


Joined: 09 Jan 2007
Posts: 17
Location: india

PostPosted: Tue Oct 20, 2009 9:06 pm
Reply with quote

thanks for responce Kolusu..I will work on it and let you know if it worked.

thanks again.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top