IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to find out duplicate column in same record


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rajesh_mbt

New User


Joined: 27 Mar 2006
Posts: 97
Location: India

PostPosted: Fri Feb 15, 2013 3:18 am
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Feb 15, 2013 4:38 am
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: 97
Location: India

PostPosted: Fri Feb 15, 2013 9:39 pm
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: 792
Location: Pennsylvania

PostPosted: Fri Feb 15, 2013 11:56 pm
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: 97
Location: India

PostPosted: Sat Feb 16, 2013 3:00 am
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Feb 16, 2013 2:26 pm
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: 792
Location: Pennsylvania

PostPosted: Tue Feb 19, 2013 6:20 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Feb 19, 2013 6:38 pm
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: 2455
Location: Hampshire, UK

PostPosted: Sat Feb 23, 2013 4:51 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top