Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

use sort to append records to existing SEQ files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: use sort to append records to existing SEQ files
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: 8593
Location: Back in jolly old England

PostPosted: Fri May 04, 2007 7:19 pm    Post subject:
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 Moderator


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

PostPosted: Fri May 04, 2007 8:50 pm    Post subject:
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

Site Director


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

PostPosted: Sat May 05, 2007 12:38 am    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Sat May 05, 2007 6:22 pm    Post subject:
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 Moderator


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

PostPosted: Sat May 05, 2007 9:18 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Sat May 05, 2007 10:45 pm    Post subject:
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

Site Director


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

PostPosted: Sun May 06, 2007 1:22 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us