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
 
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: 1542
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: 7314

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: 1542
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 Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm

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