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

JCL sorting.


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

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Tue May 22, 2012 1:23 pm
Reply with quote

Hi there,

I have two files of same LRECL and have same data.
I want to sort these files via four fields and want to remove duplicates only via those four fields.
Now there is one more field in the files(different than sorted fields),
and on the basis of this field, I want to remove duplicates.
Can you please help me with that?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue May 22, 2012 1:42 pm
Reply with quote

If you want to remove duplicates, you'll need to sort on the fifth field as well, else how is anything to know about all the duplicates?

Then, what is wrong with SUM FIELDS=NONE?

If that isn't going to work for you, you'll have to explain it better, with examples of the input and the expected output for that input.

It is irrelevant if there are two files and you are going to sort them together, it is one file by the time the sort sees it.
Back to top
View user's profile Send private message
ppandey07

New User


Joined: 27 Nov 2008
Posts: 51
Location: Delhi, India

PostPosted: Tue May 22, 2012 2:19 pm
Reply with quote

Bill Woodger wrote:
If you want to remove duplicates, you'll need to sort on the fifth field as well, else how is anything to know about all the duplicates?

Then, what is wrong with SUM FIELDS=NONE?

If that isn't going to work for you, you'll have to explain it better, with examples of the input and the expected output for that input.

It is irrelevant if there are two files and you are going to sort them together, it is one file by the time the sort sees it.


Fifth field has a different constant value in each file. Let’s say first file has value A and second has value B in fifth field. And If the concatenation of these two files causes any duplicate record (on the basis of first four field) then I want to remove duplicate and want
To keep record from first file only(with value A).

Please let me know if more information is required.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue May 22, 2012 2:50 pm
Reply with quote

So, OPTION EQUALS, sort on four fields. SUM FIELDS=(NONE)

Try it.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue May 22, 2012 2:59 pm
Reply with quote

as long as the concatenation of files in SORTIN is file with 'A' first.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue May 22, 2012 3:04 pm
Reply with quote

Worth pointing out. Pankaj, don't just "say" it, make it so, else you'll get the wrong ones.

EDIT: That means document it that way as well, so someone "cleverer" than you doesn't "correct" the order of the files because it is somehow neater, or something dumb like that.
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
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Sorting a record spanned over multipl... DFSORT/ICETOOL 13
No new posts Creating additional seqnum/Literal wh... DFSORT/ICETOOL 4
No new posts ICETOOL Sorting and Discarding DUPS SYNCSORT 11
No new posts Sorting on text - but in non-alphabet... SYNCSORT 5
Search our Forums:

Back to Top