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

Joining VB Files and getting unmatched records...


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Tue Apr 28, 2009 3:48 pm
Reply with quote

Hi , Im new to ICETOOL programming.... Here is my requirement , i need to get unmatched records from File A(VB/4504) and FileB(VB/4504) after comparing two files on key pos 5-13

File1:
AAAAAAAAAAAAA
BBBBBBBBBBBBB
CCCCCCCCCCCC
EEEEEEEEEEEEEEE

File2:
AAAAAAAAAAAAA
BBBBBBBBBBBBB
CCCCCCCCCCCC
DDDDDDDDDDDD

output file should contain:

EEEEEEEEEEEEEEE

I have used the below code for comparision but am not getting the required output . Please let me know if i have missed something here or pls suggest the code that would accomplish this task ....

Code:
//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input fileA (VB/4504)
//IN2 DD DSN=...  input fileB (VB/4504)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (VB/4504)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(5,13,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(1,4,5:C'1',6:4500)
/*
//CTL2CNTL DD *
  INREC BUILD=(1,4,5:C'2',6:4500)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(5,1,CH,EQ,C'1'),
    BUILD=(1,4,5:4500)
/*



Thank you.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 28, 2009 3:58 pm
Reply with quote

By inserting the 1 or 2 into position 5, you have effectively moved the comparison field from 5,13 to 6,13

Try this and see what happens
Code:

SELECT FROM(T1) TO(OUT) ON(6,13,CH) NODUPS USING(CTL3)
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 Apr 28, 2009 8:45 pm
Reply with quote

Hima,

You had the right idea, but you got the ON field position and variable part of the record position wrong. 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 fileA (VB/4504)
//IN2 DD DSN=...  input fileB (VB/4504)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (VB/4504)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SELECT FROM(T1) TO(OUT) ON(6,13,CH) NODUPS USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(1,4,5:C'1',6:5)
/*
//CTL2CNTL DD *
  INREC BUILD=(1,4,5:C'2',6:5)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(5,1,CH,EQ,C'1'),
    BUILD=(1,4,5:6)
/*
Back to top
View user's profile Send private message
Hima1985

New User


Joined: 17 Apr 2009
Posts: 70
Location: India

PostPosted: Wed Apr 29, 2009 10:27 am
Reply with quote

Expat & Frank, Thank you so much for your inputs !!! it worked finally ...
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 0
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top