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
 

 

Getting the duplicate key base records/ USing SPLICE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Aaru

Senior Member


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

PostPosted: Thu Aug 02, 2007 2:53 pm    Post subject: Getting the duplicate key base records/ USing SPLICE
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: 1288
Location: Chennai, India

PostPosted: Thu Aug 02, 2007 2:56 pm    Post subject: Re: Getting the duplicate key base records/ USing SPLICE
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: 1439
Location: Bangalore,India

PostPosted: Thu Aug 02, 2007 3:18 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Thu Aug 02, 2007 3:48 pm    Post subject: Re: Getting the duplicate key base records/ USing SPLICE
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Thu Aug 02, 2007 4:16 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Thu Aug 02, 2007 4:26 pm    Post subject: Re: Getting the duplicate key base records/ USing SPLICE
Reply with quote

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

Senior Member


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

PostPosted: Thu Aug 02, 2007 5:47 pm    Post subject: Re: Getting the duplicate key base records/ USing SPLICE
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    Post subject:
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Aug 02, 2007 9:16 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Fri Aug 03, 2007 12:35 pm    Post subject: Re: Getting the duplicate key base records/ USing SPLICE
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    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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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