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
 

 

Removing duplicate rows with some extraneous fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Wed Nov 15, 2006 10:48 am    Post subject: Removing duplicate rows with some extraneous fields
Reply with quote

Hi,
I am having a dataset with following format -
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+
                                                                     DATE OF RUN: 11-01-06
XXXXXXXX                         ZZZZZZZZZZZZ                MESSAGE
------------                     -------------------       ------------
DATA1                               DATA2                     MSG1             
AAAAA                               BBBBBBBBBBBB                         PAGE 1

                                                                     DATE OF RUN: 11-01-06
XXXXXXXX                         ZZZZZZZZZZZZ                MESSAGE
------------                     -------------------       ------------
DATA1                               DATA2                     MSG2             
AAAAA                               BBBBBBBBBBBB                         PAGE 2

                                                                     DATE OF RUN: 11-01-06
XXXXXXXX                         ZZZZZZZZZZZZ               MESSAGE
------------                     -------------------       ------------
DATA1                               DATA2                     MSG1             
AAAAA                               BBBBBBBBBBBB                         PAGE 3

                                                                     DATE OF RUN: 11-01-06
XXXXXXXX                         ZZZZZZZZZZZZ               MESSAGE
------------                     -------------------       ------------
DATA1                               DATA2                     MSG3             
AAAAA                               BBBBBBBBBBBB                         PAGE 4

But I want to get the output file with only the different MSGs only. So I have to use SORT on 50th column onwards like below -
Code:

//SYSIN    DD *                   
 SORT FIELDS=(53,44,CH,A)         
 INCLUDE COND=(50,21,CH,NE,C'DATE OF RUN: 11-01-06',
                           53,7,CH,NE,C'MESSAGE',
                           50,12,CH,NE,C'------------',
                           65,4,CH,NE,C'PAGE',
                          )
 OUTREC FIELDS=(1:50,44)         
 SUM FIELDS=NONE                 
/*                               


But still I am not being able to remove the headers and all other fields. All the fields are coming aling with the unique MSGs list. Can you help me out to remove the extraneous fields like - DATE OF RUN, PAGE, ------------- and MESSAGE. I just want the output file looks like the following -
Code:

MSG1
MSG2
MSG3
:
:
:
Back to top
View user's profile Send private message

shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Wed Nov 15, 2006 11:13 am    Post subject: Re: Removing duplicate rows with some extraneous fields
Reply with quote

hi Amit,
Code Exclude condition in your sort control as follows.

SOrt on MSG
SORT FIELDS=(63,......)
OMIT COND=(70,11,CH,EQ,C'Date of run',<- TO IDENTIFY THE DATE LINE
62,7,CH,EQ'MESSAGE'', <-TO IDENTIFY THE MESAGE LINE
59,12,CH,EQ'------------', <- IDENTIFU --------
1,10,CH,EQ' ') <- IDENTIFY THE BLANK LINE


Please recheck the column number in the condition.

~Vamsi
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: Wed Nov 15, 2006 10:53 pm    Post subject:
Reply with quote

You can use a DFSORT job like this to do what you want:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=... output file
//SYSIN    DD    *
  OMIT COND=(50,12,CH,EQ,C'DATE OF RUN:',OR,
             53,7,CH,EQ,C'MESSAGE',OR,
             50,12,CH,EQ,C'------------',OR,
             65,4,CH,EQ,C'PAGE')
  SORT FIELDS=(53,44,CH,A)
  SUM FIELDS=NONE
  OUTREC FIELDS=(1:50,44)
/*
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Thu Nov 16, 2006 9:22 am    Post subject:
Reply with quote

Hi,
Thanx a lot for your help.
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 Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm


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