Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Data security erase on RAID device steve-myers All Other Mainframe Topics 0 Sat Jan 13, 2018 6:41 am
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm
No new posts Append the milliseconds to the data s... girishb2 DFSORT/ICETOOL 1 Thu Dec 21, 2017 9:07 pm
No new posts Moving a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us