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
 

 

Comparing two files - NOMATCH Records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Comparing two files - NOMATCH Records
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: 1187
Location: Bangalore,India

PostPosted: Thu Dec 14, 2006 4:00 pm    Post subject:
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 Moderator


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

PostPosted: Thu Dec 14, 2006 10:04 pm    Post subject:
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    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 getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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