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

select the duplicate block of records in to a separate file


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

New User


Joined: 21 Sep 2006
Posts: 17

PostPosted: Thu Nov 05, 2009 8:15 pm
Reply with quote

HI, I have a situation where I have to select only the duplicate block of records. Each block has multiple records with first record of the block starting with '04' and last record of the block starting with with '00'. If there is only one block I dont want that blcok in my o/p file.

My i/p file is like this
04 11111
05 11111
01 11111
00 11111

04 11111
05 11111
01 11111
00 11111

04 22222
05 22222
05 22222
07 22222
01 22222
00 22222

04 44444
05 44444
05 44444
05 44444
01 44444
00 44444

04 44444
05 44444
05 44444
05 44444
01 44444
00 44444

04 66666
05 66666
05 66666
05 66666
01 66666
00 66666


My o/p file should be like:

04 11111
05 11111
01 11111
00 11111

04 11111
05 11111
01 11111
00 11111

04 44444
05 44444
05 44444
05 44444
01 44444
00 44444

04 44444
05 44444
05 44444
05 44444
01 44444
00 44444
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Nov 05, 2009 10:56 pm
Reply with quote

paresh.ojha,

The following DFSORT/ICETOOL JCl will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*     
//DFSMSG   DD SYSOUT=*     
//IN       DD * 
04 11111                                                   
05 11111                                                   
01 11111                                                   
00 11111                                                   
04 11111                                                   
05 11111                                                   
01 11111                                                   
00 11111                                                   
04 22222                                                   
05 22222                                                   
05 22222                                                   
07 22222                                                   
01 22222                                                   
00 22222                                                   
04 44444                                                   
05 44444                                                   
05 44444                                                   
05 44444                                                   
01 44444                                                   
00 44444                                                   
04 44444                                                   
05 44444                                                   
05 44444                                                   
05 44444                                                   
01 44444                                                   
00 44444                                                   
04 66666                                                   
05 66666                                                   
05 66666                                                   
05 66666                                                   
01 66666                                                   
00 66666                                                   
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE) 
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                             
  SELECT FROM(IN) TO(T1) ON(81,13,CH) ALLDUPS USING(CTL1)   
  SORT FROM(T1) USING(CTL2)                                 
//CTL1CNTL DD *                                             
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,ZD,EQ,4),             
  PUSH=(81:4,5,SEQ=8,ID=8))                 
  OUTFIL FNAMES=T1,BUILD=(1,80,94,8)         
//CTL2CNTL DD *                             
  SORT FIELDS=(81,8,CH,A)                   
  OUTFIL FNAMES=OUT,BUILD=(1,80)             
//*
Back to top
View user's profile Send private message
paresh.ojha

New User


Joined: 21 Sep 2006
Posts: 17

PostPosted: Fri Nov 06, 2009 12:07 am
Reply with quote

Thanks Kolusu,
This was really helpful
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top