View previous topic :: View next topic
|
Author |
Message |
deogaurav
New User
Joined: 17 May 2008 Posts: 1 Location: India
|
|
|
|
I have a requirement in which i have to sort a file on 2 fields and then remove duplicate records for that field.
Do we have a process like OUTPUT PROCEDURE as in cobol for easytrieve.
One approach that i can follow is like
sorting the file in one easytrieve program
reading it in another EasyTrieve program and remove duplicates.
But i do not want to use 2 codes.
Kindly help |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
What's wrong with the good old DFSORT/SYNCSORT?
O. |
|
Back to top |
|
|
anandinmainframe
Active User
Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
deogaurav,
Easytrieve is mainly used for Report purposse as ofer asked why dont you do in DFSORT which will be simple. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Easytrev (using syncsort ) JCL :
//$ORTPARM DD UNIT=SYSDA,SPACE=(CYL,1)
FILE $ORTPARM FB(80 6160)
SORTREC 1 80 A
INPUT(NULL)
SORTREC = ' SUM FIELDS=NONE'
PUT $ORTPARM
SORT infile TO outfile USING(sort keys)
* nullifying the sort parameter for sorts not interested in duplicates
INPUT(NULL)
SORTREC = ''
PUT $ORTPARM |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If there are only a few records, sorting within Easytrieve is not so bad. If there is a high volume of records, it is usually not appropriate.
One approach would be tu use your sort product to get the file in sequence and then the Easytrieve to do the processing (depending on what all the code needs to do).
If the process is only to remove duplicates on the sort key (no other code whatever), i'd surely look into doing the entire process with the sort. |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
With all respect Dick, but sorting within Easytrev is just calling/linking Syncsort or any sort product. And after the sort job is done, Easytrev is getting control again to eventually process the sorted data.
And yes if only duplicates have to be removed i agree with your last line,
but i thought that the TS mentioned Easytrev to sort and to continue to process the sorted data in the same Easytrev. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
but sorting within Easytrev is just calling/linking Syncsort or any sort product. |
True kinda, but An Oversimplification i believe. . .
Suggest you try this both ways with a high volume of long records (say 50 million records of 4k each) that are in completely random order. If what happens with this test is the same as what has happened in every test i've seen in the past comparing Easytrieve sort, the COBOL internal sort, and an external/stand-alone sort (although the last time i saw this compared was over 10 years ago and there have been several changes to many of the "players" in that time), the stand-alone sort was much faster. I should mention that most of this testing used Syncsort.
Add-on . . .
As i said earlier, if the volume is small it would not be an issue. |
|
Back to top |
|
|
|