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
 

 

JCL: how to write duplicate records in other file using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Pravesh

New User


Joined: 30 Jul 2009
Posts: 32
Location: Gurgaon

PostPosted: Thu Jun 03, 2010 12:13 pm    Post subject: JCL: how to write duplicate records in other file using sort
Reply with quote

Hi All,
I have a file e.g
10222 abc
10222 abc
10222 abc
10344 cde
10888 efh

I want to eliminate duplicate records and want to write in the output file A at same time I want to write all the duplicate records in file B.

In above case output file should be like this:-
File A should have
10222 abc
10344 cde
10888 efh

and File B should have:-
10222 abc
10222 abc

we can use sum fields = none for removing duplicate records but how to write duplicate record in file B ?

Any help would be appreciated.

Rgrds,
Pravesh
Back to top
View user's profile Send private message

geekram

New User


Joined: 09 May 2010
Posts: 4
Location: Mumbai, India

PostPosted: Thu Jun 03, 2010 12:22 pm    Post subject:
Reply with quote

Hi,

Define a new file with SORTXSUM.
And write SUM FIELDS=NONE,XSUM.

So this will copy all duplicate records from input to the another file.

Cheers,
Ram.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 03, 2010 1:11 pm    Post subject:
Reply with quote

Because the solution for sort related questions may vary from product to product, please ensure that you state clearly which sort product you are using.

If you are not sure, then by running a simple sort step shown below, you will be able to find out for yourself.

If the messages start with ICE then your product is DFSORT and the topic will be moved to the DFSORT forum by one of the moderators. Please also post the output of the complete line which has a message code ICE201I, as this will enable our DFSORT experts to determine which release of DFSORT that you have installed. This may also affect the solution offered.

If the messages start with WER or SYT then the product is SYNCSORT and the topic will remain in the JCL forum. Please also post the information telling which version of SYNCSORT is installed, as this may also affect the solution offered.

Thank you for taking your time to ensure that the valuable time of others is not wasted by offering inappropriate solutions which are not relevant due to the sort product being used and/or the release that is installed in your site.

Code:
//SORTSTEP EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  SORT     FIELDS=COPY


You also need to provide more detail than you already have.
The RECFM & LRECL of the input and output files.
The position, length and format of the key fields.
Is there any requirement for having the first, last or any of the duplicate records.
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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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