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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am


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