Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

compare files and write out mismatches using DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: compare files and write out mismatches using DFSORT
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    Post subject:
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    Post subject: thanks Kolusu
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us