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

Removing duplicate rows with some extraneous fields


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Nov 15, 2006 10:53 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Exclude rows with > than x occurre... DFSORT/ICETOOL 6
No new posts Duplicate several members of/in one l... JCL & VSAM 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
Search our Forums:

Back to Top