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

what is the procedure to merge two vsam datasets


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Mon Mar 12, 2007 8:05 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Mon Mar 26, 2007 2:06 pm
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
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: 8797
Location: Welsh Wales

PostPosted: Mon Apr 23, 2007 6:06 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Apr 24, 2007 8:49 pm
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: 8797
Location: Welsh Wales

PostPosted: Wed Apr 25, 2007 12:40 pm
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Apr 25, 2007 1:04 pm
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: 8797
Location: Welsh Wales

PostPosted: Wed Apr 25, 2007 1:15 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts CVDA value for RRDS VSAM dataset. CICS 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
No new posts Open VSAM File in IMS DC Region - DFS... IMS DB/DC 0
Search our Forums:

Back to Top