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
 

 

Remove Duplicates and update the count in trailer record.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
rajkumarmf1985

New User


Joined: 09 Aug 2010
Posts: 18
Location: bangalore

PostPosted: Tue Apr 09, 2013 12:18 pm    Post subject: Remove Duplicates and update the count in trailer record.
Reply with quote

Hi

Could anyone help on how to achieve the below requirement,

My requirement is to eliminate duplicate recs and update the trailer record count.

Input Data :
HDR~record
ABC~1234
ABC~1224
ABC~1233
ABC~1234
ABC~1233
TRL~00005 -count

I want output as below :
HDR~record
ABC~1234
ABC~1224
ABC~1233
TRL~00003 -count

I want to do this using syncsort as we dont have DFSORT in our shop.

Thanks in Advance,
Raj
Back to top
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Tue Apr 09, 2013 12:19 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

search the forum, the question has been asked and the solution has been given quite a few times.
Back to top
View user's profile Send private message
rajkumarmf1985

New User


Joined: 09 Aug 2010
Posts: 18
Location: bangalore

PostPosted: Tue Apr 09, 2013 2:49 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Hi Enricco,

My bad luck When searched i could find the sample's on DFSORT and not on the SYNCSORT.

Can you provide some links for the same.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7307

PostPosted: Tue Apr 09, 2013 3:04 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

And did you try any of the DFSORT examples?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10232
Location: italy

PostPosted: Tue Apr 09, 2013 3:07 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Quote:
Hi Enricco,


please learn to not misspell people's names

My name is Enrico, not Enricco
Back to top
View user's profile Send private message
rajkumarmf1985

New User


Joined: 09 Aug 2010
Posts: 18
Location: bangalore

PostPosted: Tue Apr 09, 2013 3:37 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Hi Bill,

I want to do this using syncsort as DFSORT will not work in our shop.


Enrico,

My apologies for the misspell.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7307

PostPosted: Tue Apr 09, 2013 3:45 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

I understand that, really I do.

However, there are enormous similarities between the products. If you find a DFSORT solution which doesn't use IFTRAIL, why don't you try it?
Back to top
View user's profile Send private message
rajkumarmf1985

New User


Joined: 09 Aug 2010
Posts: 18
Location: bangalore

PostPosted: Tue Apr 09, 2013 3:52 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Yes Bill, as per the DFSORT smaple's i have seen for Trailer count updation. I understand that IFTRAIL is the only way we have for updating the trailer count.

Correct me if i am wrong.
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Tue Apr 09, 2013 4:41 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Hi Raj,

You want the output in same non-sorted order which you have provided or can it be in sorted order ?

Thanks
-3nadh
Back to top
View user's profile Send private message
rajkumarmf1985

New User


Joined: 09 Aug 2010
Posts: 18
Location: bangalore

PostPosted: Tue Apr 09, 2013 4:56 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Hi Trinadh,

I want the records to be sorted and then eliminate the duplicates.

I tried with below sort card,

SORT FIELDS=(01,1500,CH,A)
SUM FIELDS=NONE
OUTFIL REMOVECC,
TRAILER1=(1:'TRL~',COUNT,15:'~~')

but i am getting output like below,
TRL~ 251 ~~

I want O/P like below,
TRL~0000000251~~

Any suggestions please,
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7307

PostPosted: Tue Apr 09, 2013 5:02 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Use EDIT.
Back to top
View user's profile Send private message
bodatrinadh

Active User


Joined: 05 Jan 2007
Posts: 101
Location: chennai (India)

PostPosted: Tue Apr 09, 2013 5:22 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Raj,

In your SORT card, COUNT is including Header and Trailer records...I think without those records it should be 249.

And also your sort card will produce duplicate trailer record.

Thanks
-3nadh
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7307

PostPosted: Tue Apr 09, 2013 5:24 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Also your header will no longer be the first record.
Back to top
View user's profile Send private message
rajkumarmf1985

New User


Joined: 09 Aug 2010
Posts: 18
Location: bangalore

PostPosted: Tue Apr 09, 2013 5:40 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Yes Raj,

As you said it is counting HDR and TRL record too.
Could anyone please suggest some other solution for this.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7307

PostPosted: Tue Apr 09, 2013 6:36 pm    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Aren't you Raj?

If you OMIT the existing trailer, then you can create a new one in OUTFIL. You should be able to adjust, and edit, the COUNT.

You need to deal with the header. Assuming no design on the file, so it can't be sorted "naturally", you want to add one byte to each record, temporarily. If the header, set it to, say, "3", else set it to, say, "7". Sort on that field first, then the rest of the record. Then drop the extra byte after the SORT, can be in OUTFIL since you have one already.

Are you removing entirely duplicated records? Ensure OPTION NOEQUALS for a little more swiftness.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Apr 09, 2013 7:54 pm    Post subject: Re: Reply to: Remove Duplicates and update the count in trai
Reply with quote

Bill Woodger wrote:
Aren't you Raj?
After a day full of stress, this is a good read. icon_smile.gif
Back to top
View user's profile Send private message
rajkumarmf1985

New User


Joined: 09 Aug 2010
Posts: 18
Location: bangalore

PostPosted: Wed Apr 10, 2013 11:05 am    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Hi All,

Thanks for your time and valuable suggestions.

Below sort card is working fine for my requirement.

Code:
OPTION VLSHRT                                     
OMIT COND=(05,04,CH,EQ,C'TRL~')                   
SORT FIELDS=(1,1500,CH,A)                         
SUM FIELDS=NONE                                   
OUTFIL REMOVECC,                                   
TRAILER1=(1:'TRL~',COUNT-1=(M11,LENGTH=10),15:'~~')


The positions of the header and trailer are not changing because data looks like below in the input file,

Code:
HDR~XXXXXXX
RMB~XXXXX~AAAA~
RMB~XXXXX~ABCB~
RMB~XXXXX~ABBB~
RMB~XXXXX~AEEE~
RMB~XXXXX~AEDB~
TRL~XXXXXXXXXX~


Thanks,
Raj.......

Code'd
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7307

PostPosted: Wed Apr 10, 2013 11:17 am    Post subject: Reply to: Remove Duplicates and update the count in trailer
Reply with quote

Thanks for letting us know.

For future reference, please learn how to use the Code tags and use them for anything where spacing needs to be preserved.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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