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
 

 

Merging of two VSAM files in to another VSAM file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Fri Dec 22, 2006 6:10 pm    Post subject: Merging of two VSAM files in to another VSAM file
Reply with quote

Hi ,

I have got two VSAM files. I need to merge these two files and copy it into another VSAM file.

I have tried using sort command SORT FIELDS = COPY , At the same time i was unsuccessfull copying the two files in to one VSAM file

Please let me know the appropriate job for this

Regards,
Jayaram
Back to top
View user's profile Send private message

William Thompson

Global Moderator


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

PostPosted: Fri Dec 22, 2006 6:17 pm    Post subject:
Reply with quote

ESDS or KSDS?
How were you "unsuccessfull"?
Tried to just concatenate the DDs?
More info would generate better responses..... icon_smile.gif
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Fri Dec 22, 2006 6:26 pm    Post subject: Re: Merging of two VSAM files in to another VSAM file
Reply with quote

Thanks for your prompt reply

Both input and ouput files are KSDS.

Hope makes it clear
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: Fri Dec 22, 2006 6:26 pm    Post subject: Re: Merging of two VSAM files in to another VSAM file
Reply with quote

Are they fixed-length or variable-length records?

Your terminology is a bit confusing. First, you say you want to merge the two VSAM files, which would mean that each file is in a proper sorted order, but then you say that you used SORT FIELDS=COPY, not MERGE FIELDS=(p,l,BI,A).

The most likely method to try is to copy each VSAM file to a single sequential file, then sort the sequential file into the proper key order, and then copy the sequential file to the output VSAM file.
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Fri Dec 22, 2006 6:31 pm    Post subject:
Reply with quote

Thanks for posting reply..

If both the files are in sorted order and if i use the option

SORT FIELDS=MERGE will it work. Pressuming both the input files are

VSAM ksds files and output file is also KSDS file.

Please let me know ..

cheers..
Back to top
View user's profile Send private message
rajandhla

Active User


Joined: 18 Oct 2005
Posts: 182
Location: Luton UK

PostPosted: Fri Dec 22, 2006 6:33 pm    Post subject:
Reply with quote

I have missed answering one question ..

All files are variable length files...
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: Fri Dec 22, 2006 8:55 pm    Post subject: Re: Merging of two VSAM files in to another VSAM file
Reply with quote

Code:

//STEP1      EXEC PGM=SORT
//SORTIN01   DD   DSN=VSAM1,DISP=OLD
//SORTIN02   DD   DSN=VSAM2,DISP=OLD
//SORTOUT    DD   DSN=VSAM3,DISP=OLD
//SYSOUT     DD   SYSOUT=*
//SYSIN      DD   *
  MERGE FIELDS=(p,m,BI,A)
/*


where p is that starting position of the key and m is the length of the key.
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 Fail to change physical VSAM filename... jacobdng CICS 6 Fri Jan 20, 2017 12:36 pm
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Underlying DB2 VSAM LDS - SMF recording vasanthz All Other Mainframe Topics 6 Thu Jan 05, 2017 4:20 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm


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