Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To seperate repeated and non-repeated records in the file.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: To seperate repeated and non-repeated records in the file.
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

Moderator


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

PostPosted: Mon Mar 30, 2009 9:19 pm    Post subject:
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 Moderator


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

PostPosted: Mon Mar 30, 2009 9:46 pm    Post subject:
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    Post subject: Reply to: To seperate repeated and non-repeated records in t
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    Post subject: Reply to: To seperate repeated and non-repeated records in t
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    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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us