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

Comparing two files - NOMATCH Records


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

New User


Joined: 28 Jul 2005
Posts: 19

PostPosted: Thu Dec 14, 2006 3:42 pm
Reply with quote

Hi,

I have two input files.

Input File F1

1111
2222
3333
5555
7777
8888

Input File F2

3333
4444
8888
9999


O/p file should contain only F2 records that are not in F1

Required O/P

4444
9999


Please provide sysin card for creating output file.


Regards,
Hari
-----------------------------------------------------------------------
"Why Repeat the old errors,if there are so many new errors to commit."
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Dec 14, 2006 4:00 pm
Reply with quote

Hi There,

Code:
//STEP0100 EXEC PGM=ICETOOL                               
//*                                                       
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//IN1      DD *                                           
1111
2222
3333
5555
7777
8888                                               
/*                                                       
//IN2      DD *                                           
3333
4444
8888
9999                                               
/*                                                       
//T1        DD DSN=&T1,SPACE=(CYL,(5,5),RLSE),DISP=(,PASS)
//T2        DD DSN=&T2,SPACE=(CYL,(5,5),RLSE),DISP=(,PASS)
//INT       DD DSN=*.T1,DISP=(OLD,PASS),VOL=REF=*.T1       
//          DD DSN=*.T2,DISP=(OLD,PASS),VOL=REF=*.T2       
//FILEB     DD SYSOUT=*                                   
//OUT       DD SYSOUT=*                                   
//TOOLIN    DD   *                                         
  COPY FROM(IN1) USING(CTL1)                               
  COPY FROM(IN2) USING(CTL2)                               
  SORT FROM(INT) USING(CTL3)                               
/*                                                         
//CTL1CNTL  DD *                                           
  OUTFIL FNAMES=T1,OUTREC=(1,80,C'1')                     
/*                                                         
//CTL2CNTL  DD   *                                         
  OUTFIL FNAMES=T2,OUTREC=(1,80,C'2')                     
/*                                                         
//CTL3CNTL  DD   *                                           
  OPTION EQUALS                                               
  SORT FIELDS=(1,4,CH,A)                                     
  SUM FIELDS=(81,1,ZD)                                       
  OUTFIL FNAMES=OUT,INCLUDE=(81,1,ZD,EQ,3),OUTREC=(1,80)     
  OUTFIL FNAMES=FILEB,INCLUDE=(81,1,CH,EQ,C'2'),OUTREC=(1,80)
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Dec 14, 2006 10:04 pm
Reply with quote

Hari,

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input files have RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN1      DD *
1111
2222
3333
5555
7777
8888
/*
//IN2      DD *
3333
4444
8888
9999
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(1,4,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'1')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'2')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(81,1,CH,EQ,C'2'),
    BUILD=(1,80)
/*
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top