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

icetool to remove duplicates by retaining header


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

New User


Joined: 05 Jul 2013
Posts: 34
Location: India

PostPosted: Tue Nov 05, 2013 11:56 am
Reply with quote

I am using below code to remove duplicates by retaining header, file1 is created in previous step


Code:
//SORT     EXEC PGM=ICETOOL                       
//TOOLMSG  DD SYSOUT=*                             
//DFSMSG   DD SYSOUT=*                             
//IN       DD DSN=FILE1,     
//            DISP=SHR                             
//OUT      DD DSN=FILE1,     
//            DISP=SHR                             
//TOOLIN DD *                                     
      DATASORT FROM(IN) TO(OUT) HEADER USING(CTL1)
//CTL1CNTL DD *                                   
  SORT FIELDS=(1,7,CH,A)                           
  SUM FIELDS = NONE                               
/*   


input file will have only one field and of size 7, need to sort and remove the duplicates except the header 'CODE|'

Code:
CODE|
xxxx+           
xx18-34         
yy18-49         
zz25-54         
zz55+           
xx65+   



but getting syntax error (RC=16)
DFSMSG showing
Code:
SORT FIELDS=(1,7,CH,A)
SUM FIELDS = NONE     
          $           

SYNTAX ERROR


what could be the syntax error here I am clueless. anybody pls help
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


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

PostPosted: Tue Nov 05, 2013 12:14 pm
Reply with quote

Use ICETOOL + SELECT + FIRST + HEADER(1)
Back to top
View user's profile Send private message
bvarun.

New User


Joined: 05 Jul 2013
Posts: 34
Location: India

PostPosted: Tue Nov 05, 2013 12:17 pm
Reply with quote

I understood this way..

your suggestion to use

Code:
SEELCT FROM(IN) TO(OUT) HEADER USING(CTL1)


instead of

Code:
DATASORT FROM(IN) TO(OUT) HEADER USING(CTL1)


pls correct me if am wrong, I don't know where to use "first".
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Tue Nov 05, 2013 12:51 pm
Reply with quote

Code:
SORT FIELDS=(1,7,CH,A)
SUM FIELDS = NONE     
          $           

SYNTAX ERROR


If you had thought to look at where the error-marker is showing you the error is, and compare yours to another SUM statement, you'd discover that the problem is with the blanks before and after "=".

If you are preserving a file header or trailer, keep the DATASORT.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


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

PostPosted: Tue Nov 05, 2013 12:53 pm
Reply with quote

Search the forum and read the Manual icon_smile.gif

By doing so you might find something else intresting for later point in time
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Nov 05, 2013 8:34 pm
Reply with quote

bvarun,

If you looked at the error it is quite obvious that you have an extra space between sum fields and none. Remove that

Code:

//TOOLIN    DD *                               
  DATASORT FROM(IN) TO(OUT) HEADER USING(CTL1)
//CTL1CNTL  DD *                               
  SORT FIELDS=(1,7,CH,A)                       
  SUM FIELDS=NONE                             
//*



Pandora-Box,

I appreciate your help but your suggestion of using SELECT with HEADER is NOT valid. Moreover OP needs to retain the header record as is. So he needs to use DATASORT or use INREC to number the first record to use with SELECT.
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 SYNCSORT/ICETOOL JOINKEYS SORT Statem... DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. ICETool reporting 2 das old dataset DFSORT/ICETOOL 13
No new posts COUNT the number of duplicates DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. SUM FIELDS=NONE in reverse - Get dupl... DFSORT/ICETOOL 9
No new posts RC8 IF duplicates DFSORT/ICETOOL 3
Search our Forums:

Back to Top