View previous topic :: View next topic
|
Author |
Message |
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
Hi frens,
I want the sort card for the following..
in a file name file1 there are records of length x(9). i need to eliminate the duplicates and write them into file 2 and write the only duplicate records of file2 into file3.
could any one help me in this regard. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Not so much a Cobol question as a Sort question?
Which sort product do you use?
Can you be a little clearer about what you want (if you want a useful answer)?
You have a file with duplicates, key is 9 characters - what position does it start from, or can we assume 1?
You want non-duplicates to one output file, duplicates to another output file. Can we assume that you want one representative of the duplicates on the first output file? If so, does it matter if first, last, any?
What are RECFM/LRECL for your files?
What have you tried yourself so far? "Duplicates" are a common theme if you do some searching of DFSORT/JCL fora. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Quote: |
I want the sort card for the following.. |
we are a help forum not a do it for me
for bad mannered people who do not even know how to ask properly
and after three years You should know better
what did You do do to help yourself while waiting lazily for somebody to the job You are getting paid for ?
if You had cared to search the forums You would have found quite a few matching topics
the topic stays here for now, later ,might be moved appropriate forum or locked or deleted
the TS attitude ( as seen from other posts from the same ) does not deserve spending time on Him |
|
Back to top |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
file1:
550235954
550235954
550235954
550235955
550235955
550235956
the above is the records in my file. using sort i want to filter the records as such all the non-duplicates into file 2 and all the duplicates into file3.
output:
file2:
550235954
550235955
550235956
file3:
550235954(2 times repeated so 2 times need to be written into file2)
550235954
550235955(1 time repeated so 1 time need to be written into file2) |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
and what do You expect from us,
show that You have done some research..
as I said before forum searching will return quite a few topics with the same issue and the relative solution
before replying I searched and checked, no reason why You would not do the same
syncsort duplicate matching nonmatching are the buzzwords,
other buzzwords for syncsort are xsum noxsum |
|
Back to top |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
hi all,
i have tries with
sort fileds=(1,09,CH,A)
SUM FILEDS=NONE
But this doesn't fulfill the above requirement right???
so asked ... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
did You care to search with the last suggestion..
and what is the reason for not looking at the manuals ?
and ...
if You' d care to ask in a better way You might receive less unpleasant comments
to make the most out of the questions You ask and to forecast the comments You might receive
it would be wise for You to read and meditate on
how to ask questions the smart way
here catb.org/~esr/faqs/smart-questions.html
or .. for a more PC language
here support.microsoft.com/kb/555375
_________________ |
|
Back to top |
|
|
hemu88
New User
Joined: 13 May 2011 Posts: 29 Location: India
|
|
|
|
pls use this sort.
Code: |
//STEP010 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=TEST.XSUM.INPUT,DISP=SHR
//SORTOUT DD DSN=TEST.XSUM.OUTPUT,DISP=SHR
//SORTXSUM DD DSN=TEST.XSUM.OUTPUT.XSUM,DISP=SHR
//SYSIN DD *
SORT FIELDS=(2,10,CH,A)
SUM FIELDS=NONE,XSUM
|
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
once again the lazy and do nothing won |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
nor really, look at the offset and lenth in the sort card |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
dbz, don't be so optimistic :-)
With his luck, his field always has at least one leading zero/space/some other fixed value and the field afterwards always has at least two. So, what the heck, it works, whack it in production! |
|
Back to top |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
HI enrico-sorichetti,
mind you language and control your tongue.... |
|
Back to top |
|
|
ram_vizag
Active User
Joined: 21 Aug 2008 Posts: 112 Location: hyd
|
|
|
|
hi hemu88,
i already had done that...its working good...anyway thanks...
enrico-sorichetti,
i think people like you should be throw from this forum...not people like us... |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
deleted
no reason to waste time keeping on the discussion |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
ram_vizag wrote: |
hi hemu88,
i already had done that...its working good...anyway thanks...
[...] |
ram, I don't believe you. enrico gave you pointers to the solution at 9:29 this morning. Six-and-a-half hours later, and after someone else has given you some pretty specific code, you claim to have done it yourself with not a word of thanks to enrico? In fact, far from thanks. I don't believe you did the code, and I can't believe your attitude.
If you think such a tactic is clever for getting solutions here, see who else agrees with you. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Thank Bill, just don' t bother,
the TS already made up his mind about him being the victim and me the bad guy |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
i think people like you should be throw from this forum...not people like us... |
The good news is that almost no one cares what you think. . .
Something i'm sure you are not conscious of is that Enrico provides more specific help to people each and every day than you probably will in the next few years - if not your entire career.
We do need people like Enrico. People like you - not so much.
Oh, yeah - this topic is locked. . . |
|
Back to top |
|
|
|