View previous topic :: View next topic
|
Author |
Message |
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 ? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Not even a JCL question |
|
Back to top |
|
|
|