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

Merging of two VSAM files in to another VSAM file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

PostPosted: Fri Dec 22, 2006 6:17 pm
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
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

Global Moderator


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

PostPosted: Fri Dec 22, 2006 6:26 pm
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
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
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

Global Moderator


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

PostPosted: Fri Dec 22, 2006 8:55 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 3
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top