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: 4649
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: 4649
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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm


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