Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Add same sequence number for duplicates in the file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Add same sequence number for duplicates in the file
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

Site Director


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

PostPosted: Fri Apr 23, 2010 9:20 pm    Post subject:
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: 500
Location: USA

PostPosted: Sat Apr 24, 2010 3:30 am    Post subject:
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    Post subject: Reply to: Add same sequence number for duplicates in the fil
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

Site Director


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

PostPosted: Mon Apr 26, 2010 9:55 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Mon Apr 26, 2010 10:41 am    Post subject:
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: 500
Location: USA

PostPosted: Mon Apr 26, 2010 8:49 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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: 500
Location: USA

PostPosted: Tue Apr 27, 2010 8:24 pm    Post subject:
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

Site Director


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

PostPosted: Tue Apr 27, 2010 9:37 pm    Post subject:
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    Post subject:
Reply with quote

Thank you all
It is working, I tried with the link
http://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

Site Director


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

PostPosted: Wed Apr 28, 2010 9:40 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us