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

Getting the duplicate key base records/ USing SPLICE


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

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Aug 02, 2007 2:53 pm
Reply with quote

I have 2 input files and my requirement is as follows

Basically, first file’s key value (cols 7-16) should be compared with the key value (cols 7-16) in second file. If it is present, it has to be written in one output file and if not present, it will be written in another file.

File 1:

[img][/img]


File2:

[img][/img]

I have coded a JCL using the SPLICE parameter of ICETOOL.

Output that i got is

[img][/img]


If you look into the first set of input records there are two 2192260829. But, the output file is having only one 2192260829 (the first record from the first set. The second record is not coming in the output file).

Is there any way by which i can extract also the second record into the output file?
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Aug 02, 2007 2:56 pm
Reply with quote

giving the file details agn as it dint get pasted

input file 1:

21966221922608292196624081AAB
21966221922608292196624081368
21966221922608282196626175368
21966221922608302196626175368

input file 2:

21966221922608282196620701KBC
21966221922608282196620702DEF
21966231922608282196620703DEF
21966241922608282196620704DEF
21966221922608282196620705111
21966221922608292196620706000
21966221922608282196626130368
21966221922608282196626143001
21966221922608282196626152368
21966221922608282196626174952
21966221922608282196626176520
21966221922608282196626177368
21966221922608282196626178ZYX
21966221922608282196626179368
21966221922608282196626181368


output file:

21966221922608292196624081AAB
21966221922608302196626175368
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Aug 02, 2007 3:18 pm
Reply with quote

Aaru,

Please let us know, wheter the IP files contain duplicate records? Also post your file attributes.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Aug 02, 2007 3:48 pm
Reply with quote

No, my input file does not contain duplicate records ! But it has got records with same value in the fields 7-16.

Input file1:

21966221922608292196624081AAB
21966221922608292196624081368
21966221922608282196626175368
21966221922608302196626175368

I need both these files in my output but not one ! All are FB with LRECL 80 !
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Aug 02, 2007 4:11 pm
Reply with quote

Aaru
check the topic Create files with matching and non-matching records at [url]http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/ [/url]
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Aug 02, 2007 4:16 pm
Reply with quote

Aaru,

Though the col 7-16 values are same for the records -

Quote:
21966221922608292196624081AAB
21966221922608292196624081368


Second record is not found in your expected OP.

Give more examples and also post more info about your requirment.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Aug 02, 2007 4:26 pm
Reply with quote

Thanks a lot !
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Thu Aug 02, 2007 5:47 pm
Reply with quote

Thanks kris for the link ! will try and let u know !

Meanwhile am listing down the requirements along with the input adn output file details as requested by murk!

input file 1:

21966221922608292196624081AAB
21966221922608292196624081368
21966221922608282196626175368
21966221922608302196626175368

input file 2:

21966221922608282196620701KBC
21966221922608282196620702DEF
21966231922608282196620703DEF
21966241922608282196620704DEF
21966221922608282196620705111
21966221922608292196620706000
21966221922608282196626130368
21966221922608282196626143001
21966221922608282196626152368
21966221922608282196626174952
21966221922608282196626176520
21966221922608282196626177368
21966221922608282196626178ZYX
21966221922608282196626179368
21966221922608282196626181368


output that i got

21966221922608282196626175368
21966221922608292196624081AAB

If you look into the first set of input records there are two 2192260829. But, the output file is having only one 2192260829 (the first record from the first set. The second record is not coming in the output file).

Expected output is:

21966221922608282196626175368
21966221922608292196624081AAB
21966221922608292196624081368
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Aug 02, 2007 7:05 pm
Reply with quote

Aaru
Quote:
If you look into the first set of input records there are two 2192260829. But, the output file is having only one 2192260829 (the first record from the first set. The second record is not coming in the output file).

Note that which ever file has the duplicate key's it should be the second i/p file.
Hope you got it!
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Aug 02, 2007 8:29 pm
Reply with quote

Aaru
Looks like your second i/p file also has duplicates.
So your case should be handled differently.
icon_confused.gif
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: Thu Aug 02, 2007 9:16 pm
Reply with quote

Aaru,

Based on what you've said, 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 *
21966221922608282196620701KBC
21966221922608282196620702DEF
21966231922608282196620703DEF
21966241922608282196620704DEF
21966221922608282196620705111
21966221922608292196620706000
21966221922608282196626130368
21966221922608282196626143001
21966221922608282196626152368
21966221922608282196626174952
21966221922608282196626176520
21966221922608282196626177368
21966221922608282196626178ZYX
21966221922608282196626179368
21966221922608282196626181368
//IN2 DD *
21966221922608292196624081AAB
21966221922608292196624081368
21966221922608282196626175368
21966221922608302196626175368
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//TOOLIN   DD    *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT1) ON(7,10,CH) KEEPBASE KEEPNODUPS -
  WITHALL WITH(1,81) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:C'BB')
/*
//CTL2CNTL DD *
  INREC OVERLAY=(81:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT1,INCLUDE=(81,2,CH,EQ,C'VB'),
     BUILD=(1,80)
  OUTFIL FNAMES=OUT2,INCLUDE=(81,2,CH,EQ,C'VV'),
     BUILD=(1,80)
/*


OUT1 will have:

Code:

21966221922608282196626175368   
21966221922608292196624081AAB   
21966221922608292196624081368   


OUT2 will have:

Code:

21966221922608302196626175368
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Aug 03, 2007 12:35 pm
Reply with quote

Thanks a lot and the code is working fine !
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 Duplicate transid's declared using CEDA CICS 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top