Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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: 4650
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 Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us