MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Duplicate Remove on 15962 length file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Thu May 31, 2012 8:27 am    Post subject: Duplicate Remove on 15962 length file Reply with quote

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
View user's profile Send private message Yahoo Messenger
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu May 31, 2012 9:30 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu May 31, 2012 12:28 pm    Post subject: Re: Duplicate Remove on 15962 length file Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Thu May 31, 2012 2:32 pm    Post subject: Reply with quote

Will the duplicates always be consecutive in the input file?
_________________
All the best,

di
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu May 31, 2012 3:02 pm    Post subject: Reply with quote

papadi wrote:
Will the duplicates always be consecutive in the input file?


I am not assuming that condition for my solution. Smile Twisted Evil Laughing
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu May 31, 2012 3:59 pm    Post subject: Reply with quote

dbzTHEdinosauer wrote:
papadi wrote:
Will the duplicates always be consecutive in the input file?


I am not assuming that condition for my solution. Smile Twisted Evil Laughing


Me neither 8)
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Thu May 31, 2012 4:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu May 31, 2012 7:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Fri Jun 01, 2012 1:14 am    Post subject: Reply with quote

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
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group