Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Mon Jul 26, 2004 8:31 am Post subject:
Phantom,
Adding a seqnum to records whenever a key changes is POSSIBLE with a trick using SPLICE. However my shop has syncsort version which does not support SPLICE. so may be frank can come up with a solution for this.
I don't think there is a way to add a seqnum whenever a key changes with traditional features available in sort. One way to do is to via exit routine. If you have Eztrieve at your shop then the folllowing will give you the results.
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Thu Jul 29, 2004 1:50 am Post subject:
Frank,
Though we donot have DFSORT at my shop, I still would like to learn how to achieve the above mentioned thro' DFSORT. Could you please provide me the solution.
Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Thu Jul 29, 2004 4:35 am Post subject:
Phantom,
The following DFSORT/ICETOOL JCL will give you the desired results. A brief explanation of the job.
The first sort operator sorts the file on the key which is in the first 3 bytes. We add a seqnum to all the records using OUTREC FIELDS. Now using sections and MIN on the trailer3 parm we get the lowest of the seqnum for each equal group key. We also create another file with all the records.
The SPLICE operator then takes in these 2 files concatenated and populates the key break seqnum for all the records. The formula is to get the key break seqnum is Seqnum - min + 1
If you want to see how the job works, create t1 and t2 as permanent datasets instead of temp datasets and see the contents of them. you need to check the byte 1,3 and 81 thru 90. Then try to apply the formula for the records in t2
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Sun Aug 22, 2004 4:02 am Post subject:
Kolusu,
One more shocking news.....I was just informed that Eazytrieve is going to be phased out from our shop. The only answer I get is COST CUTTING !!!!!!!!!
I was told that Eazytrive is going to be replaced by SAS. Similarly lots of utilties are being replaced...I don't want to use any of these third party tools here...b'cas they might replace them any moment...
Could you please provide me a ASSEMBLER equivalent (Using SORT E35 EXIT)of your Eazytrieve code.
Note: I never used ASSEMBLER before. I just downloaded some manuals on HLASM.
I would not want to be responsible for supporting a production assembler program (esp. an internal sort) without being adept at Assembler. From what you have described, there seems to be no good reason for an Assembler module.
Why not do it the easy way instead?
Step 1: Have a SORT step.
Step 2: Write a little program in any language to do what you want.
Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
Posted: Mon Aug 23, 2004 11:49 am Post subject:
I understand Mikebaker,
But the input file will be dynamic. Meaning the LRECL varies from time to time. though I can allocate a file dynamically using COBOL the LRECL should be fixed.
I'm also looking a way to acheive this using C in mainframes. Not sure how successful I would be.
Ok, that is a good reason to use Assembler. However, to do this in Assembler dynamically is also non-standard Assembler programming. I have seen examples of this, and it is a bit fiddly.
You can either use the SYS1.MACLIB(DCBD) member, and then code the appropriate control block inquiry code in your program, or I think (without referencing the manual), the RDJFCB macro might be able to do the same.
I would definitely hunt for an easier solution, and only use Assember as a last resort. It could be real nasty if you got to be reliant on this in prod, and it failed.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Jun 30, 2005 10:42 am Post subject:
You can do this kind of thing much more easily and efficiently using the new RESTART parameter of DFSORT available with z/OS V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004). Here's the job:
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum