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.
Joined: 01 Dec 2006 Posts: 711 Location: Pennsylvania
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.