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

Question abount XSUM or SELECT FROM(IN)


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

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Sat Jun 19, 2010 1:21 am
Reply with quote

Hello there. I have a question about eliminating duplicates. Let's say I have a file with duplicates. If I use XSUM, can I eliminate dups and in the same step reformat output file which has dups.
This is my JCL (it doesn't work, only to show my input):
Code:
//TOOLMSG DD SYSOUT=*                                         
//DFSMSG DD SYSOUT=*                                         
//IN    DD *                                                 
----+----1----+----2----+----3----+----4----+----5----+----6--
AAAAAXXXXX1111111111XXXXXXXXXXXXXX                           
AAAAAXXXXX1111111111XXXXXXXXXXXXXX                           
AAAAAXXXXX1111111111XXXXXXXXXXXXXX                           
BBBBBXXXXX2222222222XXXXXXXXXXXXXX                           
BBBBBXXXXX2222222222XXXXXXXXXXXXXX                           
CCCCCXXXXX3333333333XXXXXXXXXXXXXX                           
/*                                                           
//OUT DD SYSOUT=*                                             
//SORTXSUM DD SYSOUT=*                                       
//TOOLIN DD *                                                 
 SELECT FROM(IN) TO(OUT) ON(1,3,CH) FIRST DISCARD(SORTXSUM) -
 USING(CTL1)                                                 
/*                                                           
//CTL1CNTL DD *                                               
  OUTREC FIELDS=(11,10)   


This is how my main output file (OUT) should look like:

Code:
AAAAAXXXXX1111111111XXXXXXXXXXXXXX
BBBBBXXXXX2222222222XXXXXXXXXXXXXX
CCCCCXXXXX3333333333XXXXXXXXXXXXXX


This is what my DUPS output (SORTXSUM) should look like:
Code:
1111111111
1111111111
2222222222
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: Sat Jun 19, 2010 1:40 am
Reply with quote

Just use the following DFSORT statements for CTL1CNTL:

Code:

//CTL1CNTL DD *                           
  OUTFIL FNAMES=OUT                       
  OUTFIL FNAMES=SORTXSUM,BUILD=(11,10)     
/*
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Sat Jun 19, 2010 1:54 am
Reply with quote

Frank, thanks. Every time you answer it looks so simple. Just awesome.
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: Sat Jun 19, 2010 2:30 am
Reply with quote

I have the DFSORT books memorized (since I wrote them). icon_wink.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 Dynamically pass table name to a sele... DB2 2
No new posts Question for file manager IBM Tools 7
No new posts SELECT from data change table DB2 5
No new posts Select two different counts from SQL... DB2 6
No new posts question for Pedro TSO/ISPF 2
Search our Forums:

Back to Top