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
 

 

what is the procedure to merge two vsam datasets

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
rkprasanth_m

New User


Joined: 22 Jun 2006
Posts: 44

PostPosted: Mon Mar 12, 2007 7:48 pm    Post subject: what is the procedure to merge two vsam datasets
Reply with quote

Would you please give me the procedure or best prastices to merge VSAM data sets
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Mon Mar 12, 2007 8:05 pm    Post subject: Re: what is the procedure to merge two vsam datasets
Reply with quote

Use a SORT MERGE, providing that there is a common key in both files, and that they're already sorted in key order.
Back to top
View user's profile Send private message
guptaa

New User


Joined: 22 Feb 2007
Posts: 10
Location: pune

PostPosted: Mon Mar 26, 2007 1:41 pm    Post subject: Re: what is the procedure to merge two vsam datasets
Reply with quote

first repro the two files into flat files
merge and sort the two files and don't forget to omit duplicates
then repro the flat file into single VSAM i think this is the simplest way to do that...
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: Mon Mar 26, 2007 2:06 pm    Post subject:
Reply with quote

Quote:
merge and sort the two files and don't forget to omit duplicates

What criteria would you use for removing duplicates.
What data will be omitted.
What is the effect on business by omitting data.

May be a duplicate key, but totally different data.
- which record do you want to delete and why.
Back to top
View user's profile Send private message
Vijay_K

New User


Joined: 23 Apr 2007
Posts: 1
Location: Bangalore

PostPosted: Mon Apr 23, 2007 5:59 pm    Post subject:
Reply with quote

For removing duplicates we have to use SUM FIELDS=NONE option in Jcl Sort
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: Mon Apr 23, 2007 6:06 pm    Post subject:
Reply with quote

Vijay_K

Quote:
For removing duplicates we have to use SUM FIELDS=NONE option in Jcl Sort

What I meant was .... if you have two records with a duplicate key in your two VSAM files, is how do you decide which of the two records to omit, and why.

What if the other fields differ, how do you decide which to drop and which to keep.

What effect will this have on the business if you drop the incorrect data, or if the data from both records is required.

My original post
Quote:
May be a duplicate key, but totally different data.
- which record do you want to delete and why.

Yes, technically the answer is correct, but financially ???
Back to top
View user's profile Send private message
rz061m

New User


Joined: 03 Mar 2006
Posts: 48
Location: Chennai

PostPosted: Tue Apr 24, 2007 8:05 pm    Post subject:
Reply with quote

expat wrote:
Vijay_K

Quote:
For removing duplicates we have to use SUM FIELDS=NONE option in Jcl Sort

What I meant was .... if you have two records with a duplicate key in your two VSAM files, is how do you decide which of the two records to omit, and why.

What if the other fields differ, how do you decide which to drop and which to keep.

What effect will this have on the business if you drop the incorrect data, or if the data from both records is required.

My original post
Quote:
May be a duplicate key, but totally different data.
- which record do you want to delete and why.

Yes, technically the answer is correct, but financially ???



Hi,

As far as these information it has to be decided by the question poster...... we cant spoon feed all these datas, see the question posted. For this sort of question this is the answer could be given.

if you start thinking financially then he has to give more details....
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Tue Apr 24, 2007 8:49 pm    Post subject: Re: what is the procedure to merge two vsam datasets
Reply with quote

if the record layout allows it a plain SORT will do
( DFSORT accepts VSAM both for input and output)

otherwise
repro the VSAM to PS files, sort, repro to VSAM

I suppose that all the application/business related concerns ( record layout, duplicate keys, ...... ) have already been worked out;
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: Wed Apr 25, 2007 12:40 pm    Post subject:
Reply with quote

Quote:
I suppose that all the application/business related concerns ( record layout, duplicate keys, ...... ) have already been worked out;

Was that a Gloucester Spot at flight level three zero ?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10256
Location: italy

PostPosted: Wed Apr 25, 2007 1:04 pm    Post subject: Re: what is the procedure to merge two vsam datasets
Reply with quote

Quote:
Was that a Gloucester Spot at flight level three zero ?


Dumb of me :-) I do not get the joke

regards

E2L e.s.
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: Wed Apr 25, 2007 1:15 pm    Post subject:
Reply with quote

A reference to an old English phrase ...........

Gloucester Spot is a breed of pig, so basically it is saying "If pigs could fly"
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts VSAM Space Allocation mrgnndhmk JCL & VSAM 7 Sat Apr 22, 2017 12:42 am
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm


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