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

Add same sequence number for duplicates in the file


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

New User


Joined: 22 May 2008
Posts: 27
Location: Bangaluru

PostPosted: Fri Apr 23, 2010 7:38 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 23, 2010 9:20 pm
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Sat Apr 24, 2010 3:30 am
Reply with quote

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
View user's profile Send private message
gileshpg

New User


Joined: 22 May 2008
Posts: 27
Location: Bangaluru

PostPosted: Mon Apr 26, 2010 9:43 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 26, 2010 9:55 am
Reply with quote

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
View user's profile Send private message
gileshpg

New User


Joined: 22 May 2008
Posts: 27
Location: Bangaluru

PostPosted: Mon Apr 26, 2010 10:08 am
Reply with quote

HI......
is there any other option for me without using PUSH??????

Thanks
Gilesh
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Apr 26, 2010 10:41 am
Reply with quote

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
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Mon Apr 26, 2010 8:49 pm
Reply with quote

Gilesh,

Which release of SyncSort for z/OS are you running?
Back to top
View user's profile Send private message
gileshpg

New User


Joined: 22 May 2008
Posts: 27
Location: Bangaluru

PostPosted: Tue Apr 27, 2010 4:04 pm
Reply with quote

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
View user's profile Send private message
gileshpg

New User


Joined: 22 May 2008
Posts: 27
Location: Bangaluru

PostPosted: Tue Apr 27, 2010 4:09 pm
Reply with quote

Hi,

i am using SYNCSORT FOR Z/OS 1.3.2.0

Thanks
Gilesh
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue Apr 27, 2010 7:09 pm
Reply with quote

gileshpg wrote:
Hi,

i am using SYNCSORT FOR Z/OS 1.3.2.0

Thanks
Gilesh

Then WHEN=GROUP should work I guess icon_question.gif icon_confused.gif
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Tue Apr 27, 2010 8:24 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Apr 27, 2010 9:37 pm
Reply with quote

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
View user's profile Send private message
gileshpg

New User


Joined: 22 May 2008
Posts: 27
Location: Bangaluru

PostPosted: Wed Apr 28, 2010 9:25 am
Reply with quote

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..........

icon_rolleyes.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Apr 28, 2010 9:40 am
Reply with quote

Hello,

Quote:
Sorry for troubling you alll..........
I suspect it was more trouble for you than for us icon_smile.gif

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
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 FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top