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 according to Data and Key part.

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

New User


Joined: 27 Jul 2006
Posts: 5
Location: Torrance

PostPosted: Tue Feb 05, 2008 12:45 am    Post subject: Compare files according to Data and Key part.
Reply with quote

Hi,

I have two Files.

FileA
Record Length: 600
Primary Key Length: 11
Primary Key position: 1-11
Data position: 12-600

Layout

010272AA001......pppppp.......
010272BB001......qqqqqq.......
010272CC001......qqqrrr.......
010272XX001......xxxyyy.......
010272KK001......mmmnnn.......

The bold-italic part represents the primary key. There are no duplicates in FileA.

FileB
Record Length: 600
Primary Key Length: 11
Primary Key position: 1-11
Data position: 12-600

Layout

010272AA001......pppppp.......
010272CC001......qqqrrr.......
010272DD001......qqqqqq.......
010272KK001......qrstuv.......

The bold-italic part represents the primary key. There are no duplicates in FileB.


I want 3 Output Files as:

File1:
Containing all the records present only in FileA
010272BB001......qqqqqq.......
010272XX001......xxxyyy.......

File2:
Containing all the records present only in FileB
010272DD001......qqqqqq.......

File3
Containing those records from FileA which are present in both FileA and FileB, have the same primary key part but different Data part.
For eg:
010272KK001......mmmnnn.......

I am able to create File1 and File2. But I am not able to create File3 where the segreggation is according to the difference in Data part.

Can you please help me regarding the same.
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: Tue Feb 05, 2008 3:13 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=... input file1 (FB/600)
//IN2 DD DSN=... input file2 (FB/600)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT1 DD DSN=...  output file1 (FB/600)
//OUT2 DD DSN=...  output file2 (FB/600)
//OUT3 DD DSN=...  output file3 (FB/600)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT1) ON(1,11,CH) KEEPNODUPS -
  WITH(602,590) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(1:1,11,12:C'1',13:12,589,1191:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(1:1,11,602:C'2',603:12,589)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT1,INCLUDE=(602,1,CH,EQ,C' '),
    BUILD=(1,11,13,589)
  OUTFIL FNAMES=OUT2,INCLUDE=(12,1,CH,EQ,C' '),
    BUILD=(1,11,603,589)
  OUTFIL FNAMES=OUT3,
    INCLUDE=(12,1,CH,EQ,C'1',AND,602,1,CH,EQ,C'2',AND,
     (13,200,CH,NE,603,200,CH,OR,
     213,200,CH,NE,803,200,CH,OR,
     413,189,CH,NE,1003,189,CH)),
    BUILD=(1,11,13,589)
/*
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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts JCL to get submitted once dataset has... vinu78 JCL & VSAM 17 Thu Feb 16, 2017 7:32 am


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