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
 
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 Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Can we combine the rows with same key... V S Amarendra Reddy DB2 12 Fri Dec 01, 2017 10:29 pm
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Conditional highlighting of rows in I... packerm CLIST & REXX 2 Thu Sep 21, 2017 6:50 pm

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