View previous topic :: View next topic
|
Author |
Message |
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
ESDS or KSDS?
How were you "unsuccessfull"?
Tried to just concatenate the DDs?
More info would generate better responses..... |
|
Back to top |
|
|
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
Thanks for your prompt reply
Both input and ouput files are KSDS.
Hope makes it clear |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
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 |
|
|
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
I have missed answering one question ..
All files are variable length files... |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
|