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

To seperate repeated and non-repeated records in the file.


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

New User


Joined: 18 Jan 2008
Posts: 30
Location: mumbai

PostPosted: Mon Mar 30, 2009 7:20 pm
Reply with quote

Hi

IS there any way to seperate repeated and non-repeated records in the file using ICETOOL, without changing order.

eg:
I/p file
---------------
mno
abc
xyz
xyz
abd
abd


O/p file 1
--------
mno
abc


O/p file 2
---------
xyz
xyz
abd
abd
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Mar 30, 2009 9:19 pm
Reply with quote

Code:


//STEP1  EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*                           
//IN          DD *
mno
abc
xyz
xyz
abd
abd
//OUT       DD SYSOUT=*
//DISC     DD SYSOUT=*
//TOOLIN DD *               
SELECT FROM(IN) TO(OUT) ON(1,3,CH) NODUPS DISCARD(DISC)
/*


Hope it helps

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: Mon Mar 30, 2009 9:46 pm
Reply with quote

hac,

premkrishnan's job does NOT create the output files "without changing order" as you requested. Here's a DFSORT/ICETOOL job that does. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1  EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN          DD *
mno
abc
xyz
xyz
abd
abd
/*
//TNODUPS DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//TDUPS DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//NODUPS DD DSN=...  output file1 (FB/80)
//DUPS   DD DSN=...  output file2 (FB/80)
//TOOLIN DD *
SELECT FROM(IN) TO(TNODUPS) ON(1,3,CH) NODUPS DISCARD(TDUPS)-
  USING(CTL1)
SORT FROM(TNODUPS) TO(NODUPS) USING(CTL2)
SORT FROM(TDUPS) TO(DUPS) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  SORT FIELDS=(81,8,ZD,A)
  OUTREC BUILD=(1,80)
/*
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Mar 30, 2009 11:42 pm
Reply with quote

Assuming that your input is FB and 80 bytes LRECL, the following DFSORT/ICETOOL JCl will give you the desired results.


Code:

//STEP0100 EXEC PGM=ICETOOL                                       
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//IN       DD *                                                   
MNO                                                               
ABC                                                               
XYZ                                                               
XYZ                                                               
ABD                                                               
ABD                                                               
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)       
//DUPS     DD SYSOUT=*                                           
//UNQ      DD SYSOUT=*                                           
//TOOLIN   DD *                                                   
  COPY FROM(IN) USING(CTL1)                                       
  COPY FROM(T1) USING(CTL2)                                       
//CTL1CNTL DD *                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,3))),
  IFTHEN=(WHEN=GROUP,BEGIN=(81,8,ZD,EQ,1),                       
  PUSH=(89:1,80),RECORDS=2)
                                       
  OUTFIL FNAMES=DUPS,INCLUDE=(81,8,ZD,GT,1),                     
  IFOUTLEN=80,IFTHEN=(WHEN=(81,8,ZD,EQ,2),BUILD=(89,80,/,1,80))   

  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,BUILD=(88X),                 
  SECTIONS=(1,3,TRAILER3=(1,88))                                 
//CTL2CNTL DD *                                                   
  OMIT COND=(81,8,ZD,GT,1)                                       
  OUTFIL FNAMES=UNQ,BUILD=(1,80)
/*
Back to top
View user's profile Send private message
hac

New User


Joined: 18 Jan 2008
Posts: 30
Location: mumbai

PostPosted: Tue Mar 31, 2009 2:23 pm
Reply with quote

Thank You all for your replies...
I got the answer. icon_biggrin.gif
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top