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 two files with Duplicates.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Wed Apr 02, 2008 5:28 pm    Post subject: Compare two files with Duplicates.
Reply with quote

Hi

I have two FB datasets. Primary key is 12 byte feild. In IN1 it start from 1st postion. In IN2 it start s from 15th postion.
IN1 is having unique records and is of LRECL = 15. IN2 is having unique as well as duplicate records and is of LRECL = 30.

I want to compare IN1 to IN2 and report in OUT1 only those records, whose key is present in IN1.

IN1

003160250993616
003160255992616
003200015992616

IN2

...003160250993616...
...003160250993616...
...003160250993616...
...003160255992616...
...003200015992616...
...003160255993616...
...003160255993616...

OUT1

...003160250993616...
...003160250993616...
...003160250993616...
...003160255992616...
...003200015992616...
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Wed Apr 02, 2008 10:53 pm    Post subject: Reply to: Compare two files with Duplicates.
Reply with quote

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

Code:

//STEP0100 EXEC PGM=ICETOOL                                           
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN1      DD DSN=your unique 15 lrecl file,
//            DISP=SHR                                               
//IN2      DD DSN=your duplicate 30 lrecl file,
//            DISP=SHR
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)         
//OUT      DD SYSOUT=*                                               
//TOOLIN   DD *                                                       
  COPY FROM(IN1) USING(CTL1)                                         
  COPY FROM(IN2) USING(CTL2)                                         
  SPLICE FROM(T1) TO(OUT) ON(15,12,CH) WITHALL WITH(01,30) USING(CTL3)
//CTL1CNTL DD *                                                       
  OUTFIL FNAMES=T1,OVERLAY=(15:1,12,31:1,12)                         
//CTL2CNTL DD *                                                       
  OUTFIL FNAMES=T1,OVERLAY=(31:12X)                                   
//CTL3CNTL DD *                                                       
  OUTFIL FNAMES=OUT,BUILD=(01,30),                                   
  INCLUDE=(15,12,CH,EQ,31,12,CH)
/*
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Thu Apr 03, 2008 10:07 am    Post subject:
Reply with quote

The output dataset is coming empty. No of records in IN1 and No of records in IN2 are different.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Apr 03, 2008 8:58 pm    Post subject:
Reply with quote

suzeet wrote:
The output dataset is coming empty. No of records in IN1 and No of records in IN2 are different.


suzeet,

I am guessing that you did not copy my JCL as is. Note that the temp dataset T1 has MOD in disp parm. If you dont have that you will not get the desired results.

If the above is NOT true then you need to show me the DFSMSG sysout to be able to help you.
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 compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts getting three output files out of JOI... migusd SYNCSORT 7 Mon Jun 05, 2017 11:30 pm
No new posts member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 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


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