View previous topic :: View next topic |
Author |
Message |
arvibala Beginner
Joined: 12 Feb 2008 Posts: 142 Topics: 67
|
Posted: Thu May 31, 2012 8:27 am Post subject: Duplicate Remove on 15962 length file |
|
|
I have a file with LRECL 15962 and Key field is 14000. I need to remove duplicates. I cudnt do it using SORT. ( We have SYNCSORT )
Can this be done with SORT Inputprocedure / Outputprocedure in COBOL?? or do we have limitations on Cobol too? _________________ Arvind
"You can make a difference with your smile. Have that with you always" |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu May 31, 2012 9:30 am Post subject: |
|
|
really dumb post removed by dbz.. _________________ Dick Brenholtz
American living in Varel, Germany
Last edited by dbzTHEdinosauer on Thu May 31, 2012 1:29 pm; edited 1 time in total |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu May 31, 2012 12:28 pm Post subject: Re: Duplicate Remove on 15962 length file |
|
|
arvibala wrote: | I have a file with LRECL 15962 and Key field is 14000. I need to remove duplicates. I cudnt do it using SORT. ( We have SYNCSORT )
Can this be done with SORT Inputprocedure / Outputprocedure in COBOL?? or do we have limitations on Cobol too? |
As DBZ mentioned earlier, SORT INPUT/OUTPUT procedures invoke resident sort product and the limitations of max key still apply.
However there is nothing stopping you from loading the entire 14000 bytes into an internal table and doing a SEARCH and load only the unique records.
Each internal table is limited to 16,777,215 bytes. Your key is 14,000 bytes , you can load upto 1100 keys per table. Here is a sample cobol program which will get you started.
http://www.mvsforums.com/helpboards/viewtopic.php?t=1718&highlight=search+occurs
Kolusu |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Thu May 31, 2012 2:32 pm Post subject: |
|
|
Will the duplicates always be consecutive in the input file? _________________ All the best,
di |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu May 31, 2012 3:02 pm Post subject: |
|
|
papadi wrote: | Will the duplicates always be consecutive in the input file? |
I am not assuming that condition for my solution. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Thu May 31, 2012 3:59 pm Post subject: |
|
|
dbzTHEdinosauer wrote: | papadi wrote: | Will the duplicates always be consecutive in the input file? |
I am not assuming that condition for my solution. |
Me neither 8) _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Thu May 31, 2012 4:38 pm Post subject: |
|
|
Nope, no assumption - just wondering if TS knows the data well enough to know this. . .
Of course, i suspect it would be rather simple to read the file and see if anything is "out of sequence". _________________ All the best,
di |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Thu May 31, 2012 7:28 pm Post subject: |
|
|
My solution is predicated on this record layout: Code: |
01 Large-Key-Record.
05 Rebuild-Info.
10 Original-Seq-No PIC 9(13).
10 Sub-Rec-Seq-no PIC 9(1).
10 Sort-Number PIC 9(1).
10 Rebuild-Tab-Def.
15 Same-as-Seq-1 PIC 9(13).
15 Same-as-Seq-2 PIC 9(13).
15 Same-as-Seq-3 PIC 9(13).
15 Same-as-Seq-4 PIC 9(13).
10 Rebuild-Tab
REDEFINES
Rebuild-tab-def.
15 Rbld-Tab-item occurs 4 times
Indexed by rbld-idx
PIC 9(13).
*** total size of rebuild info 67
05 Sort Key.
10 Prev-order-tab-def.
15 Order-from-Sort-1 PIC 9(13).
15 Order-from-Sort-2 PIC 9(13).
15 Order-from-Sort-3 PIC 9(13).
15 Order-from-Sort-4 PIC 9(13).
10 Prev-order-tab
REDEFINES
Prev-order-tab-def.
15 Prev-order-Tab-item occurs 4 times
Indexed by Prev-idx
PIC 9(13).
10 DATA PIC X(3500).
*** total size of sort key 3552
*******total record size 3619
|
_________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
arvibala Beginner
Joined: 12 Feb 2008 Posts: 142 Topics: 67
|
Posted: Fri Jun 01, 2012 1:14 am Post subject: |
|
|
Im Sorry Dick ... I didnt know that COBOL Sort invokes resident SORT product ... Thanks for the help to all _________________ Arvind
"You can make a difference with your smile. Have that with you always" |
|
Back to top |
|
|
|
|