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
 

 

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: 1534
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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