Keyboard Shortcuts
Likes
Search
Eliminating duplicate records.
Hi folks.
I've been playing with OS-360 SORT for MVS 3.8. Documentation is clear and, overall, I've been quite successful in sorting records (I feel I'm not handling 100% correctly my temporary datasets in JCL with PASS stuff etc, but overall, got it working). However, as it came quite instinctively to my mind to wonder if I could get rid of duplicate records, I found that the SUM feature that I find everywhere when googling around the matter to be capable of doing that, is nowhere in the SORT program we have at hands (My guess is that the version of SORT we do have here maybe is a really very old one). While I grasp there's some room for SORT to work together with other programs with all that exit routines stuff (way beyond my comprehension), I thought maybe someone has some clue how to handle such a trivial use-case (geting rid of duplicate records) under MVS 'the easy way'. Thank you in advance. Cheers. |
Hi Alejandro, To address your immediate requirement could I suggest that you take advantage of the Sort/Merge E35 exit and provide such an exit to detect duplicate records and delete them from the output data set? The IVP members provide examples of E35 exits written in assembler or you could write a COBOL or PLI/F program to invoke the Sort/Merge program and drive an E35 exit. |
Thank you for your points.
Being a complete noob, after successfully using SORT for MVS directly, yesterday I got it working under COBOL (the only language I know a little and I play with) after following with interest another thread on the group about SORT under COBOL. I did that in Tk5, and the only issues I had were due to my lack of experience with COBOL and SORT. But once I got it working, I think I can achieve my goal programatically, by just coding a further iteration of the sorted data, droping duplicates as I write to a final output... possibly not an elegant/efficient approach, but that's what I'm capable off :-P I read with interest the Sort/Merge Exit stuff. I felt that there lies the elegant way to extend that software functionalities, and it is interesting to know that, for this ise-case scenario, E35 is the one that would do the trick... but all that is waaaaay beyond my skills :-P Thank you very much for your work! Cheers. |
Hi:
I'm probably missing something, but on SORT program under JCL you can use SUM FIELDS=NONE to remove duplicates. For instance SORT FIELDS=(1,10,CH,A) SUM FIELDS=NONE Will sort and delete any duplicates under same criteria (having same value on positions 1 to 10). Also on COBOL it can be made, I can search for an example I made like 15 years ago if you want. Regards.? |
Hi David.
AFAIK (I tried anyways) the implementation of SORT present in Tk5 (I guess in Tk4- too, along with the one referenced by Jay Moseley in his website... both with all that 60's 2311/2314 DASD dependency) seems to be a very old one (I guess by its name, it is from OS/360...so 60's stuff), that pre-dates the one that usually folks refer to on blogs, guides, etc.. when someone googles around. There's a very nice, modern, pdf documentation about OS/360 SORT/MERGE for MVS 3.8 included (which, as Tom, pointed before, basically allows to use more recent DASDs), and it is consistent with the behaviour... So I think the popular SUM FIELDS=NONE comodity found around appears to be a facility of later versions and/or operating systems (I guess possibly on the 80's...who knows :-P). Cheers. |
Hi Alejandro,
I have E35 exit code that can drop duplicates. Please correspond with me offline too avoid to many messages in the group and I can most likely amend it to fit your requirements. At the moment it simply takes ONE offset and length in the record and uses this as the duplicate data test. Best regards, τσ尘 ( e: botongrui@... ) |