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
 

 

icetool to remove duplicates by retaining header

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: icetool to remove duplicates by retaining header
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

Moderator


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

PostPosted: Tue Nov 05, 2013 12:14 pm    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Tue Nov 05, 2013 12:51 pm    Post subject: Re: icetool to remove duplicates by retaining header
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

Moderator


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

PostPosted: Tue Nov 05, 2013 12:53 pm    Post subject:
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    Post subject: Reply to: icetool to remove duplicates by retaining header
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    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 Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am


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