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

Compare files according to Data and Key part.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Tue Feb 05, 2008 3:13 am
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 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 Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
Search our Forums:

Back to Top