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 2 files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
shanudarling
Warnings : 1

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Fri Jun 15, 2012 11:22 pm    Post subject: Merging 2 files
Reply with quote

I have 2 sequential files and both have the same record length.
File A contains some data
File B contains notes

My task is copy the contents of file B into file A at the end of file A.
Both the files cannot be sorted as we cannot change the sequence of records.

File A
Code:

1|-1234.56|ABC|987.11|
WW1|ACCDGFHJJJ|987|123.11|
4|-1234.56|ABCCFDS|123987.11|
EFJ1|1A2WWE3|145678.99|QQWXXF|


File B
Code:

AAACGFDSGS SDLFSD SLFLS LSDF
SDFDSDSFLGRG GRELGREG WEWLF
DSFDSK R432R3 LGF SNGLKS 4324


Expected Output file -
Code:

1|-1234.56|ABC|987.11|
WW1|ACCDGFHJJJ|987|123.11|
4|-1234.56|ABCCFDS|123987.11|
EFJ1|1A2WWE3|145678.99|QQWXXF|
AAACGFDSGS SDLFSD SLFLS LSDF
SDFDSDSFLGRG GRELGREG WEWLF
DSFDSK R432R3 LGF SNGLKS 4324


I am exploring if this can be done by a JCL only?

Thanks
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jun 15, 2012 11:27 pm    Post subject:
Reply with quote

Hello,

No, because NOTHING can be done "with a JCL only".

Suggest you concatenate the 2 input files and write a new output containing all of the records.

You can use your sort to do this.
Back to top
View user's profile Send private message
shanudarling
Warnings : 1

New User


Joined: 20 Dec 2006
Posts: 55
Location: noida

PostPosted: Mon Jun 18, 2012 10:11 am    Post subject:
Reply with quote

Merged the files using the below jcl. Worked fine.

Code:

//STEP0001  EXEC  PGM=ICEMAN               
//SYSOUT    DD  SYSOUT=*                   
//SORTIN  DD DSN=DTEM.TEST.DATA.A,DISP=SHR 
//        DD DSN=DTEM.TEST.DATA.B,DISP=SHR 
//SORTOUT DD DSN=DTEM.TEST.DATA.C,DISP=SHR 
//SYSIN    DD    *                         
  OPTION COPY                               
/*                                         
[/code]
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Mon Jun 18, 2012 11:33 am    Post subject:
Reply with quote

Hi,

you have copied/concatenated 2 files, not MERGED 2 files.

Gerry
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Jun 18, 2012 6:43 pm    Post subject:
Reply with quote

Hello,

Quote:
Merged the files using the below jcl. Worked fine.
Yes, it worked because you did as suttested - concatenate the 2 input files.

Regardless of your improper use of the word "merge" you did NO merge. MERGE says there is a sequence to the data (some key(s) and typically data from the multiple files is interleaved by the merge process.

After doing this for more than 5 years, you should be using the correct terminology. Every time.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm


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