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

use sort to append records to existing SEQ files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rally

New User


Joined: 28 Jul 2005
Posts: 37

PostPosted: Fri May 04, 2007 7:14 pm
Reply with quote

Hi,

I have an case need advise:

there are 2 files A & B, A with 100,000,000 records
and B with 20,000 records, the 1st 10 bytes of each records is the key of
final VSAM files.

currently, we use below scenario.
Sortin dd dsn=A
dd dsn=B
sortout DD dsn=C.

Is it possible use below scenario? need ensure all records in file A remain.
and records in file B add to proper postion of file A.
sortin dd dsn=B
sortout dd dsn=A
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri May 04, 2007 7:19 pm
Reply with quote

I believe that you will not be able to use that method as you will need to have the records in KEY sequence to load to the VSAM file.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri May 04, 2007 8:50 pm
Reply with quote

That depends on the type of VSAM file (KSDS, ESDS, etc).

A VSAM KSDS must have the records in order of its key. So you can't "append" the B records to the end of the A file unless the B records are in key order and the first key of the B file is higher than the last key of the A file.

For the other types of VSAM files (e.g. ESDS), you may be able to do the append.

Note that to do the append, either the VSAM data set must be defined without REUSE, or you must use DFSORT's NORESET option.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat May 05, 2007 12:38 am
Reply with quote

Hello,

You might consider a MERGE rather than sorting the 100million (assuming they are already in the key sequence).

If you needed to sort B before the merge, that would not require many machine resources.
Back to top
View user's profile Send private message
rally

New User


Joined: 28 Jul 2005
Posts: 37

PostPosted: Sat May 05, 2007 5:58 pm
Reply with quote

dick scherrer wrote:
Hello,

You might consider a MERGE rather than sorting the 100million (assuming they are already in the key sequence).

If you needed to sort B before the merge, that would not require many machine resources.


Thanks for your suggestion, file A and B are key sorted seq file.

do you mean we will get better perforamnce if we use 'MERGE' to put A & B to new SEQ file C, compare with 'SORT' to put A & B to new SEQ file C?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat May 05, 2007 6:22 pm
Reply with quote

rally wrote:
do you mean we will get better perforamnce if we use 'MERGE' to put A & B to new SEQ file C, compare with 'SORT' to put A & B to new SEQ file C?
If I understand, yes, why resort already sorted records......
But, from what I recall of sort, it will be smart enough to realize that the bulk of the data is already in sequence and will quickly be into its final merge out.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat May 05, 2007 9:18 pm
Reply with quote

Quote:
do you mean we will get better perforamnce if we use 'MERGE' to put A & B to new SEQ file C, compare with 'SORT' to put A & B to new SEQ file C?


Yes, a MERGE is more efficient than a SORT. A SORT may need to use intermediate storage (hiperspace or work data sets) - a MERGE never has to use intermediate storage.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat May 05, 2007 10:45 pm
Reply with quote

I get the impression that both files A and B are sorted previously.

I suppose if this is the case that you could omit the previous sorts and just sort the two files once as a concatenated SORTIN.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun May 06, 2007 1:22 am
Reply with quote

Hello,

If both are in sequence, MERGE is the faster choice.

MERGE need only read both files and write the output - no work files are ever needed.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top