View previous topic :: View next topic
Author
Message
Hima1985 New User Joined: 17 Apr 2009Posts: 70 Location: India
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
expat Global Moderator Joined: 14 Mar 2007Posts: 8797 Location: Welsh Wales
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
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
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
Hima1985 New User Joined: 17 Apr 2009Posts: 70 Location: India
Expat & Frank, Thank you so much for your inputs !!! it worked finally ...
Back to top
Please enable JavaScript!