View previous topic :: View next topic
Author
Message
gileshpg New User Joined: 22 May 2008Posts: 27 Location: Bangaluru
Hi,
Using Sync sort I need to add a sequence number to every duplicate records. Duplicates should have the same number.
Input
931,00120,00050.00,025-000-123456789-001,CA,
931,00140,00060.00,025-000-123456789-001,CA,
931,00150,00070.00,025-000-123456789-001,CA,
931,00120,00050.00,025-000-123456791-001,CA,
931,00140,00060.00,025-000-123456791-001,CA,
931,00150,00070.00,025-000-123456791-001,CA,
931,00120,00050.00,025-000-123456795-001,CA,
931,00140,00060.00,025-000-123456795-001,CA,
931,00150,00070.00,025-000-123456795-001,CA,
931,00120,00080.00,025-000-123456789-002,CA,
931,00140,00090.00,025-000-123456789-002,CA,
931,00150,00100.00,025-000-123456789-002,CA,
Output needed
931,00120,00050.00,025-000-123456789-001,CA,1
931,00140,00060.00,025-000-123456789-001,CA,1
931,00150,00070.00,025-000-123456789-001,CA,1
931,00120,00050.00,025-000-123456791-001,CA,1
931,00140,00060.00,025-000-123456791-001,CA,1
931,00150,00070.00,025-000-123456791-001,CA,1
931,00120,00050.00,025-000-123456795-001,CA,1
931,00140,00060.00,025-000-123456795-001,CA,1
931,00150,00070.00,025-000-123456795-001,CA,1
931,00120,00080.00,025-000-123456789-002,CA,2
931,00140,00090.00,025-000-123456789-002,CA,2
931,00150,00100.00,025-000-123456789-002,CA,2
The key will be 025-000-123456789-001, 025-000-123456789-002 in the location 20-40(21 bytes). I am using Sync sort.......
Please help me on this?
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello and welcome to the forum,
The posted "output" does not appear to follow "the rules". . .
Suggest you repost some input with less similar values and the output needed form the new input. Clarification of the rules would also help. . .
Back to top
Alissa Margulies SYNCSORT Support Joined: 25 Jul 2007Posts: 496 Location: USA
gileshpg ,
Here is a SyncSort for z/OS 1.3.2 job that will produce the output you posted in your previous post.
However, please note that the sort key does not exactly match the description you had provided...
Code:
//SORT1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTIN DD *
931,00120,00050.00,025-000-123456789-001,CA,
931,00140,00060.00,025-000-123456789-001,CA,
931,00150,00070.00,025-000-123456789-001,CA,
931,00120,00050.00,025-000-123456791-001,CA,
931,00140,00060.00,025-000-123456791-001,CA,
931,00150,00070.00,025-000-123456791-001,CA,
931,00120,00050.00,025-000-123456795-001,CA,
931,00140,00060.00,025-000-123456795-001,CA,
931,00150,00070.00,025-000-123456795-001,CA,
931,00120,00080.00,025-000-123456789-002,CA,
931,00140,00090.00,025-000-123456789-002,CA,
931,00150,00100.00,025-000-123456789-002,CA,
//SYSIN DD *
SORT FIELDS=(38,3,CH,A,20,18,CH,A)
OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,1,ZD,RESTART=(38,3))),
IFTHEN=(WHEN=GROUP,BEGIN=(81,1,ZD,EQ,1),PUSH=(45:ID=1))
OUTFIL BUILD=(1,80)
/*
Back to top
gileshpg New User Joined: 22 May 2008Posts: 27 Location: Bangaluru
Hi,
This will work using ICETOOL, the other Sync sort utility i am using won't support PUSH....
Please give me something that doesnt have PUSH and BEGIN..
Thanks
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Then you should use ICETOOL. . .
If your version of Syncsort does not support PUSH, you need to have the current release installed.
Back to top
gileshpg New User Joined: 22 May 2008Posts: 27 Location: Bangaluru
HI......
is there any other option for me without using PUSH??????
Thanks
Gilesh
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
If you want a solution "now", suggest you write the code.
Also suggest that you talk with your manager or those responsible for software upgrade priorities and explain that most quick solutions require current software. Why should people waste time providing solutions using old releases? The release of Syncort that supports PUSH is not at all new. . .
Back to top
Alissa Margulies SYNCSORT Support Joined: 25 Jul 2007Posts: 496 Location: USA
Gilesh,
Which release of SyncSort for z/OS are you running?
Back to top
gileshpg New User Joined: 22 May 2008Posts: 27 Location: Bangaluru
Hi,
Now i have to use the version currently i am having...
let me simplify the problem
Input will be
AAAAA
AAAAA
AAAAA
BBBBB
BBBBB
CCCCC
DDDDD
Output i need
AAAAA 1
AAAAA 1
AAAAA 1
BBBBB 2
BBBBB 2
CCCCC3
DDDDD4
Can anyone help me on this without using PUSH and BEGIN...
Thanks
Gilesh
Back to top
gileshpg New User Joined: 22 May 2008Posts: 27 Location: Bangaluru
Hi,
i am using SYNCSORT FOR Z/OS 1.3.2.0
Thanks
Gilesh
Back to top
Escapa Senior Member Joined: 16 Feb 2007Posts: 1399 Location: IL, USA
gileshpg wrote:
Hi,
i am using SYNCSORT FOR Z/OS 1.3.2.0
Thanks
Gilesh
Then WHEN=GROUP should work I guess
Back to top
Alissa Margulies SYNCSORT Support Joined: 25 Jul 2007Posts: 496 Location: USA
Gilesh,
Support for WHEN=GROUP was included in SyncSort for z/OS 1.3.2.0. Why can't you use it?
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Is there some reason that the diagnostic information from the problem run has not been posted. . .?
Copy/paste the complete set of messages (including message ids) from the problem run.
Back to top
gileshpg New User Joined: 22 May 2008Posts: 27 Location: Bangaluru
Thank you all
It is working, I tried with the link
ibmmainframes.com/about47201.html
So it was showing some error at that stage.......
the code above is working fine for me......
Sorry for troubling you alll..........
Back to top
dick scherrer Moderator Emeritus Joined: 23 Nov 2006Posts: 19244 Location: Inside the Matrix
Hello,
Quote:
Sorry for troubling you alll..........
I suspect it was more trouble for you than for us
Quote:
the code above is working fine for me......
It may help someone else some day if you post why the above code did not work originally. . .
Back to top
Please enable JavaScript!