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
 

 

Want to merge the two files in to an another file

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

New User


Joined: 27 Aug 2006
Posts: 8

PostPosted: Sun Aug 27, 2006 8:07 pm    Post subject: Want to merge the two files in to an another file
Reply with quote

icon_eek.gif
Sir,
i have two sequential files having LRECL=80, now i want to merge the two files in to an another file... two files are merged according to the criteria that they have value in the particular fields.. i gave the below statement it is not working... what is the solution
Code:
                         
 //SORTING      EXEC     PGM=ICEMAN                                     
 //SYSOUT       DD       SYSOUT=*                                       
 //SORTIN01     DD       DSN=EDUC32.COBOL.EXT4,DISP=SHR                 
 //SORTIN02     DD       DSN=EDUC32.COBOL.EXT3,DISP=SHR                 
 //SORTOUT      DD       DSN=EDUC32.COBOL.EXT5,DISP=(MOD,CATLG),         
 //             SPACE=(TRK,(1,1)),UNIT=SYSDA,DCB=(LRECL=80,RECFM=FB,     
 //             BLKSIZE=29720)                                           
 //SYSIN        DD       *                                               
  MERGE FIELDS=(1,7,BI,A,33,7,BI,A)                                     

the fields which should have same value are specified as 1-7 in first file and 33-40 in second file.....
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: Mon Aug 28, 2006 1:04 am    Post subject: Re: I WANT TO MERGE TWO SEQUENTIAL FILES AND STORE IT
Reply with quote

If you want to MERGE files, each file to be merged must already be in the order you use for the MERGE statement. For example, if you want to use:

MERGE FIELDS=(1,7,BI,A,33,7,BI,A)

then each input file to be merged must already have been sorted by 1,7,BI,A,33,7,BI,A. If the input files are not already sorted, then you would concatenate and SORT them rather than MERGE them.
Back to top
View user's profile Send private message
balaji_g_m

New User


Joined: 27 Aug 2006
Posts: 8

PostPosted: Mon Aug 28, 2006 1:45 am    Post subject: how to concatenate.. give me the syntax please
Reply with quote

yes,, i understood. could u give me the syntax please
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Aug 28, 2006 8:49 pm    Post subject:
Reply with quote

Quote:
could u give me the syntax please


Merge Example - records in each file must already be in sorted order - output will be in sorted order

Code:

//M1 EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN01 DD DSN=...  input file1
//SORTIN02 DD DSN=...  input file2
//SORTOUT  DD DSN=...  output file
//SYSIN    DD    *
  MERGE FIELDS=(1,7,BI,A,33,7,BI,A)
/*


Sort Example - records in each file can be in any order - output will be in sorted order

Code:

//S1 EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1
//       DD DSN=...  input file2
//SORTOUT  DD DSN=...  output file
//SYSIN    DD    *
  SORT FIELDS=(1,7,BI,A,33,7,BI,A)
/*


Copy Example - records in each file can be in any order - output will be in same order as input (file1, then file2)

Code:

//C1 EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1
//       DD DSN=...  input file2
//SORTOUT  DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
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


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