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
 

 

How to find out duplicate column in same record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 95
Location: India

PostPosted: Fri Feb 15, 2013 3:18 am    Post subject: How to find out duplicate column in same record
Reply with quote

I've a requirement where need to find out any duplicate column/values repeating in the same record.

Eg.

Input record layout as : Card_no, address, bank, account #(10 times)

Need to find out any acct# is repeating out of those 10 occurance.
This validation has to be performed for each record.

Can we do in Sort or something else in JCL?
Appreciate your efforts and help in advance!!
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Fri Feb 15, 2013 4:38 am    Post subject: Reply to: How to find out duplicate column in same record
Reply with quote

Well, you'll need nine IFTHENs for the first field, eight for the second, seven for the third, etc. Good new is, you'll not need any for the last.

If you find a match, set a "flag", select on that with OUTFIL OMIT/INCLUDE.
Back to top
View user's profile Send private message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 95
Location: India

PostPosted: Fri Feb 15, 2013 9:39 pm    Post subject: Reply to: How to find out duplicate column in same record
Reply with quote

Thanks Bill..
Seems it required several if conditions and more complex.

Is any other technique that we could help us to simplify in the sort.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Fri Feb 15, 2013 11:56 pm    Post subject:
Reply with quote

Quote:
Is any other technique that we could help us to simplify in the sort.


Rajesh,

We have Bill helping you here, an expert with 4000+ posts.

Which is more likely:

1) He picked the best solution he knows of with his wealth of experience.

2) He skipped over a simple technique and gave you a more complex option, until of course you ask for the simple one.
Back to top
View user's profile Send private message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 95
Location: India

PostPosted: Sat Feb 16, 2013 3:00 am    Post subject:
Reply with quote

Daveporcelan,
I Knew that Bill would have given one of his solution. Apart from him, somebody else also could post alternate solution if any. So, that question is open to everyone..

Also, this is discussion forum to get different ideas/solution. I hope you got it!
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Sat Feb 16, 2013 2:26 pm    Post subject: Reply to: How to find out duplicate column in same record
Reply with quote

Thanks for the support Dave.

rajesh_mbt,

It is far from a "complex" solution (although you would have discovered you'd need HIT=NEXT, which I failed to mention, when you wrote the second line of code), it is just code, perhaps too much for you.

In a programming language, you'd not have so much code, as you'd use "looping" and "arrays", neither of which exist in Sort products.

Why I wrote in such a short-hand way is because you didn't even bother to say what result you wanted.

We still don't know.

Depending on the result that you want, Madmartinsoxx posted something you could use last night. Less code, but more machine resources, which you're not paying for, but someone is.

There's always more than one way to crack an egg. It is rare that the best way is "so that I have to code less, even though it is less efficient".

Personally, I'd use symbols/SYMNAMES in the code, and with effective use of the editor (for a small task like this) or rexx/Sort to generate cards, even the "lots of code stuff" hardly takes a moment.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Tue Feb 19, 2013 6:20 pm    Post subject:
Reply with quote

Quote:
Also, this is discussion forum to get different ideas/solution. I hope you got it!


I get it all right. But I am not sure you do.

This is the way your requests appear to the to those you are asking for help. Please do not take this as a personal attack. This is just so you understand the reality of how experts view this 'discussion of ideas'.

1) The original poster states general requirements with no real specific details. They then ask a yes/no question (Bill should have said 'yes it can be done with sort, period). They then thank in advance for other peoples effort, but gave very little effort of their own.

2) An expert posted a proposed solution. This is something the poster can take and run with. Meaning, start coding and see how well this solution would work.

3) Poster does not not run with the solution, but rather says it seems too complex. Translation, it is too much work for me, can you (or someone else) come up with something easier so I do not have to work so hard. Do not be angry at me, this is how nearly every expert translates your response.

I get it for sure. I would have coded what Bill suggested as soon as I read his response. If I ran into trouble, I would have posted my code, and the issue I had. Bill and others would see the EFFORT I have given, and helped me work it out. In the interim, others may have suggested other ideas if they had them.

I would not have whined that it was too hard and continue to do nothing.

Be honest with yourself and say (to yourself) how hard have you worked on this. If you have indeed worked hard, you need to show that in your responses on this forum. That is how it works, show effort to receive help.

Good luck.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 19, 2013 6:38 pm    Post subject: Reply to: How to find out duplicate column in same record
Reply with quote

Quote:
Apart from him, somebody else also could post alternate solution if any.


You got a working solution FULL STOP

why should we waste time providing something different ? icon_evil.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Sat Feb 23, 2013 4:51 am    Post subject:
Reply with quote

Not even a JCL question icon_mad.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 2 Sun Nov 06, 2016 8:11 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm


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