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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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